Commit 03ffd858 authored by hrchilds's avatar hrchilds

Update from March 30, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@646 18c085ea-50e0-402c-830e-de6fd14e8384
parent 8a5858ff
......@@ -1340,3 +1340,57 @@ GetVisItLauncher()
return std::string(GetVisItInstallationDirectory() + "/bin/visit");
#endif
}
// ****************************************************************************
// Method: VisItStat
//
// Purpose: platform independent stat function that supports large files
// when possible
//
// Programmer: Mark C. Miller
// Creation: March 23, 2006
//
// ****************************************************************************
int
VisItStat(const char *file_name, VisItStat_t *buf)
{
#if defined(_WIN32)
return _stat(name, &statbuf);
#else
#if SIZEOF_OFF64_T > 4
return stat64(file_name, buf);
#else
return stat(file_name, buf);
#endif
#endif
}
// ****************************************************************************
// Method: VisItFStat
//
// Purpose: platform independent fstat function that supports large files
// when possible
//
// Programmer: Mark C. Miller
// Creation: March 23, 2006
//
// ****************************************************************************
int
VisItFstat(int fd, VisItStat_t *buf)
{
#if defined(_WIN32)
return _fstat(fd, &statbuf);
#else
#if SIZEOF_OFF64_T > 4
return fstat64(fd, buf);
#else
return fstat(fd, buf);
#endif
#endif
}
......@@ -5,6 +5,7 @@
#ifndef UTILITY_H
#define UTILITY_H
#include <utility_exports.h>
#include <visit-config.h>
#include <string>
#include <vector>
......@@ -17,6 +18,21 @@ typedef enum {CONFIGSTATE_IOERROR,
CONFIGSTATE_FIRSTTIME,
CONFIGSTATE_SUCCESS} ConfigStateEnum;
#if defined(_WIN32)
typedef struct _stat VisItStat_t;
typedef off_t VisItOff_t;
#else
#if SIZEOF_OFF64_T > 4
typedef struct stat64 VisItStat_t;
typedef off64_t VisItOff_t;
#else
typedef struct stat VisItStat_t;
typedef off_t VisItOff_t;
#endif
#endif
//
// Function Prototypes
//
......@@ -53,6 +69,9 @@ UTILITY_API char * GetSystemConfigFile(const char *filename = 0);
int UTILITY_API ConfigStateGetRunCount(ConfigStateEnum &code);
void UTILITY_API ConfigStateIncrementRunCount(ConfigStateEnum &code);
int UTILITY_API VisItStat(const char *filename, VisItStat_t *buf);
int UTILITY_API VisItFstat(int fd, VisItStat_t *buf);
inline char *C_strdup(char const * const);
inline char *CXX_strdup(char const * const);
inline void InlineCopy(char *&, const char * const &, const int &);
......
......@@ -533,6 +533,9 @@ avtDatabaseFactory::VisitFile(const char *visitFile, int timestep,
// I changed the code so it gives a different kind of exception if the
// desired file does not exist.
//
// Mark C. Miller, Thu Mar 30 16:45:35 PST 2006
// Made it use VisItStat instead of stat
//
// ****************************************************************************
#if defined(_WIN32)
......@@ -564,8 +567,8 @@ CheckPermissions(const char *filename)
SetUpUserInfo();
}
struct stat s;
int rv = stat(filename, &s);
VisItStat_t s;
int rv = VisItStat(filename, &s);
if (rv < 0)
{
if(errno == ENOENT || errno == ENOTDIR)
......
##
## Site configuration for an Linux system. Any special configuration that
## should be done on an Linux system should go in here.
##
# the -D_LARGEFILE64_SOURCE flag ensures that symbols such as stat64()
# and off64_t can be used explicitly in the source code
CXXFLAGS="-D_LARGEFILE64_SOURCE $CXXFLAGS"
# Even though VisIt is a C++ code, we need to fiddle with CFLAGS too
# because autoconf's sizeof tests only use the C compiler
CFLAGS="-D_LARGEFILE64_SOURCE $CFLAGS"
......@@ -105,8 +105,8 @@ DEFAULT_NETCDF_LIB=/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib
##
## Silo
##
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/lib
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/lib
##
## ViSUS
......
......@@ -105,8 +105,8 @@ DEFAULT_NETCDF_LIB=/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib
##
## Silo
##
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/lib
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/lib
##
## ViSUS
......
......@@ -105,8 +105,8 @@ DEFAULT_NETCDF_LIB=/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib
##
## Silo
##
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/lib
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/lib
##
## ViSUS
......
......@@ -105,8 +105,8 @@ DEFAULT_NETCDF_LIB=/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib
##
## Silo
##
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/lib
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/lib
##
## ViSUS
......
......@@ -24,7 +24,7 @@ MESA=$VISITHOME/mesa
##
## Specify the location of the vtk include files and libraries.
##
VTK=$VISITHOME/vtk
VTK=$VISITHOME/vtk/2003.10.28c/linux_redhat_gcc_2.96
##
## If QT is not set, use VisIt's Qt.
......
......@@ -105,8 +105,8 @@ DEFAULT_NETCDF_LIB=/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib
##
## Silo
##
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/lib
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/lib
##
## ViSUS
......
......@@ -105,8 +105,8 @@ DEFAULT_NETCDF_LIB=/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib
##
## Silo
##
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/lib
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/lib
##
## ViSUS
......
......@@ -105,8 +105,8 @@ DEFAULT_NETCDF_LIB=/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib
##
## Silo
##
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre1/linux_rhel3_gcc_3.2.3/lib
DEFAULT_SILO_INCLUDES=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/include
DEFAULT_SILO_LIBRARY=/usr/gapps/silo/4.5.1-pre4/linux_rhel3_gcc_3.2.3/lib
##
## ViSUS
......
......@@ -16669,6 +16669,371 @@ _ACEOF
#
# Use size of off64_t to determine which form of stat() calls to make
#
echo "$as_me:$LINENO: checking for off64_t" >&5
echo $ECHO_N "checking for off64_t... $ECHO_C" >&6
if test "${ac_cv_type_off64_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if ((off64_t *) 0)
return 0;
if (sizeof (off64_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_type_off64_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_off64_t=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_off64_t" >&5
echo "${ECHO_T}$ac_cv_type_off64_t" >&6
echo "$as_me:$LINENO: checking size of off64_t" >&5
echo $ECHO_N "checking size of off64_t... $ECHO_C" >&6
if test "${ac_cv_sizeof_off64_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$ac_cv_type_off64_t" = yes; then
# The cast to unsigned long works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
if test "$cross_compiling" = yes; then
# Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (off64_t))) >= 0)];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_lo=0 ac_mid=0
while :; do
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (off64_t))) <= $ac_mid)];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_hi=$ac_mid; break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo=`expr $ac_mid + 1`
if test $ac_lo -le $ac_mid; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (off64_t))) < 0)];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_hi=-1 ac_mid=-1
while :; do
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (off64_t))) >= $ac_mid)];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_lo=$ac_mid; break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_hi=`expr '(' $ac_mid ')' - 1`
if test $ac_mid -le $ac_hi; then
ac_lo= ac_hi=
break
fi
ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.$ac_objext conftest.$ac_ext
done
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo= ac_hi=
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (off64_t))) <= $ac_mid)];
test_array [0] = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_hi=$ac_mid
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_off64_t=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off64_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (off64_t), 77
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; } ;;
esac
else
if test "$cross_compiling" = yes; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
long longval () { return (long) (sizeof (off64_t)); }
unsigned long ulongval () { return (long) (sizeof (off64_t)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
FILE *f = fopen ("conftest.val", "w");
if (! f)
exit (1);
if (((long) (sizeof (off64_t))) < 0)
{
long i = longval ();
if (i != ((long) (sizeof (off64_t))))
exit (1);
fprintf (f, "%ld\n", i);
}
else
{
unsigned long i = ulongval ();
if (i != ((long) (sizeof (off64_t))))
exit (1);
fprintf (f, "%lu\n", i);
}
exit (ferror (f) || fclose (f) != 0);
;
return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_sizeof_off64_t=`cat conftest.val`
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off64_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (off64_t), 77
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
ac_cv_sizeof_off64_t=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_off64_t" >&5
echo "${ECHO_T}$ac_cv_sizeof_off64_t" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t
_ACEOF
echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
if test "${ac_cv_c_bigendian+set}" = set; then
......
......@@ -3097,6 +3097,11 @@ AC_CHECK_SIZEOF(void *,0)
AC_CHECK_SIZEOF(boolean,0)
#
# Use size of off64_t to determine which form of stat() calls to make
#
AC_CHECK_SIZEOF(off64_t)
AC_C_BIGENDIAN
dnl
......
......@@ -29,6 +29,7 @@
#include <TimingsManager.h>
#include <DebugStream.h>
#include <Utility.h>
using std::string;
......@@ -147,6 +148,9 @@ avtANSYSFileFormat::ActivateTimestep()
// Brad Whitlock, Wed Jul 27 10:55:58 PDT 2005
// Fixed for win32.
//
// Mark C. Miller, Thu Mar 30 16:45:35 PST 2006
// Made it use VisItStat instead of stat
//
// ****************************************************************************
bool
......@@ -172,20 +176,14 @@ avtANSYSFileFormat::ReadFile(const char *name, int nLines)
int nCells = 100;
if(nLines == ALL_LINES)
{
#if defined(_WIN32)
struct _stat statbuf;
_stat(name, &statbuf);
off_t fileSize = statbuf.st_size;
#else
struct stat statbuf;
stat(name, &statbuf);
off_t fileSize = statbuf.st_size;
#endif
VisItStat_t statbuf;
VisItStat(name, &statbuf);
VisItOff_t fileSize = statbuf.st_size;
// Make a guess about the number of cells and points based on
// the size of the file.
nPoints = fileSize / 190;
nCells = fileSize / 210;
nPoints = fileSize / (VisItOff_t) 190;
nCells = fileSize / (VisItOff_t) 210;
}
vtkPoints *pts = vtkPoints::New();
pts->Allocate(nPoints);
......
......@@ -22,6 +22,8 @@
#include <InvalidVariableException.h>
#include <InvalidFilesException.h>
#include <Utility.h>
using std::string;
......@@ -115,6 +117,9 @@ avtAUXFileFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// Brad Whitlock, Fri Jun 17 14:53:02 PST 2005
// Modified so it works on Windows.
//
// Mark C. Miller, Thu Mar 30 16:45:35 PST 2006
// Made it use VisItStat instead of stat
//
// ****************************************************************************
vtkDataSet *
......@@ -129,15 +134,9 @@ avtAUXFileFileFormat::GetMesh(const char *meshname)
//
// Read the whole file's contents into a buffer
//
#if defined(_WIN32)
struct _stat statbuf;
_stat(fileName.c_str(), &statbuf);
off_t fileSize = statbuf.st_size;
#else
struct stat statbuf;
stat(fileName.c_str(), &statbuf);
off_t fileSize = statbuf.st_size;
#endif
VisItStat_t statbuf;
VisItStat(fileName.c_str(), &statbuf);
VisItOff_t fileSize = statbuf.st_size;
FILE *fd = fopen(fileName.c_str(), "r");
if(fd == 0)
......
......@@ -27,6 +27,7 @@
#include "vtkStructuredGrid.h"
#include "vtkStructuredPoints.h"
#include "vtkUnstructuredGrid.h"
#include "Utility.h"
#include <sys/stat.h>
#include <ctype.h>
......@@ -66,6 +67,9 @@ vtkVisItEnSight6BinaryReader::~vtkVisItEnSight6BinaryReader()
}
}
// Mark C. Miller, Thu Mar 30 16:45:35 PST 2006
// Made it use VisItStat instead of stat
//
//----------------------------------------------------------------------------
int vtkVisItEnSight6BinaryReader::OpenFile(const char* filename)
{
......@@ -85,8 +89,8 @@ int vtkVisItEnSight6BinaryReader::OpenFile(const char* filename)
// Open the new file
vtkDebugMacro(<< "Opening file " << filename);
struct stat fs;
if ( !stat( filename, &fs) )
VisItStat_t fs;
if ( !VisItStat( filename, &fs) )
{
// Find out how big the file is.
this->FileSize = (int)(fs.st_size);
......
......@@ -26,6 +26,7 @@
#include "vtkRectilinearGrid.h"
#include "vtkStructuredGrid.h"
#include "vtkUnstructuredGrid.h"
#include "Utility.h"
#include <sys/stat.h>
#include <ctype.h>
......@@ -55,6 +56,9 @@ vtkVisItEnSightGoldBinaryReader::~vtkVisItEnSightGoldBinaryReader()