summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-09-25 10:24:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-09-25 10:24:06 (GMT)
commitf148bcf93bd6308c33c81c54a462b10ab74a6eee (patch)
treefed33ad75384a72729075c5b02d2810d34016c84
parenta1b98c1345199717e8be03f8f0ed04fb0466e840 (diff)
downloadtcl-f148bcf93bd6308c33c81c54a462b10ab74a6eee.zip
tcl-f148bcf93bd6308c33c81c54a462b10ab74a6eee.tar.gz
tcl-f148bcf93bd6308c33c81c54a462b10ab74a6eee.tar.bz2
Lots more type changes. Added Tcl_AllocStatBuf()...
-rw-r--r--doc/FileSystem.319
-rw-r--r--generic/tcl.decls29
-rw-r--r--generic/tcl.h18
-rw-r--r--generic/tclCmdAH.c28
-rw-r--r--generic/tclFCmd.c10
-rw-r--r--generic/tclFileName.c30
-rw-r--r--generic/tclIOUtil.c14
-rw-r--r--generic/tclInt.decls10
-rw-r--r--generic/tclInt.h26
-rw-r--r--generic/tclTest.c22
-rw-r--r--mac/tclMacFile.c8
-rw-r--r--unix/tclUnixFCmd.c41
-rw-r--r--unix/tclUnixFile.c48
-rw-r--r--win/tclWinFile.c12
14 files changed, 190 insertions, 125 deletions
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3
index 97f1a78..f0962c3 100644
--- a/doc/FileSystem.3
+++ b/doc/FileSystem.3
@@ -4,13 +4,13 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: FileSystem.3,v 1.6 2001/09/08 14:05:09 vincentdarley Exp $
+'\" RCS: @(#) $Id: FileSystem.3,v 1.6.6.1 2001/09/25 10:24:06 dkf Exp $
'\"
.so man.macros
.TH Tcl_FSCopyFile 3 8.4 Tcl "Tcl Library Procedures"
.BS
.SH NAME
-Tcl_FSRegister, Tcl_FSUnregister, Tcl_FSData, Tcl_FSCopyFile, Tcl_FSCopyDirectory, Tcl_FSCreateDirectory, Tcl_FSDeleteFile, Tcl_FSRemoveDirectory, Tcl_FSRenameFile, Tcl_FSListVolumes, Tcl_FSEvalFile, Tcl_FSLoadFile, Tcl_FSMatchInDirectory, Tcl_FSLink, Tcl_FSLstat, Tcl_FSUtime, Tcl_FSFileAttrsGet, Tcl_FSFileAttrsSet, Tcl_FSFileAttrStrings, Tcl_FSStat, Tcl_FSAccess, Tcl_FSOpenFileChannel, Tcl_FSGetCwd, Tcl_FSChdir, Tcl_FSPathSeparator, Tcl_FSJoinPath, Tcl_FSSplitPath, Tcl_FSEqualPaths, Tcl_FSGetNormalizedPath, Tcl_FSJoinToPath, Tcl_FSConvertToPathType, Tcl_FSGetInternalRep, Tcl_FSGetTranslatedPath, Tcl_FSGetTranslatedStringPath, Tcl_FSNewNativePath, Tcl_FSGetNativePath, Tcl_FSFileSystemInfo \- procedures to interact with any filesystem
+Tcl_FSRegister, Tcl_FSUnregister, Tcl_FSData, Tcl_FSCopyFile, Tcl_FSCopyDirectory, Tcl_FSCreateDirectory, Tcl_FSDeleteFile, Tcl_FSRemoveDirectory, Tcl_FSRenameFile, Tcl_FSListVolumes, Tcl_FSEvalFile, Tcl_FSLoadFile, Tcl_FSMatchInDirectory, Tcl_FSLink, Tcl_FSLstat, Tcl_FSUtime, Tcl_FSFileAttrsGet, Tcl_FSFileAttrsSet, Tcl_FSFileAttrStrings, Tcl_FSStat, Tcl_FSAccess, Tcl_FSOpenFileChannel, Tcl_FSGetCwd, Tcl_FSChdir, Tcl_FSPathSeparator, Tcl_FSJoinPath, Tcl_FSSplitPath, Tcl_FSEqualPaths, Tcl_FSGetNormalizedPath, Tcl_FSJoinToPath, Tcl_FSConvertToPathType, Tcl_FSGetInternalRep, Tcl_FSGetTranslatedPath, Tcl_FSGetTranslatedStringPath, Tcl_FSNewNativePath, Tcl_FSGetNativePath, Tcl_FSFileSystemInfo, Tcl_AllocStatBuf \- procedures to interact with any filesystem
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -125,6 +125,9 @@ char*
.sp
Tcl_Obj*
\fBTcl_FSFileSystemInfo\fR(\fIpathPtr\fR)
+.sp
+Tcl_StatBuf*
+\fBTcl_AllocStatBuf\fR()
.SH ARGUMENTS
.AS Tcl_Filesystem *fsPtr in
.AP Tcl_Filesystem *fsPtr in
@@ -544,6 +547,12 @@ further categorization of files.
A valid list object is returned, unless the path object is not
recognized, when NULL will be returned.
.PP
+\fBTcl_AllocStatBuf\fR allocates a \fITcl_StatBuf\fR on the system
+heap (which may be deallocated by being passed to \fBckfree\fR.) This
+allows extensions to invoke \fBTcl_FSStat\fR and \fBTcl_FSLStat\fR
+without being dependent on the size of the buffer. That in turn
+depends on the flags used to build Tcl.
+.PP
.SH TCL_FILESYSTEM
.PP
@@ -797,7 +806,7 @@ See the documentation of '
.CS
typedef int Tcl_FSStatProc(
Tcl_Obj *\fIpathPtr\fR,
- struct stat *\fIstatPtr\fR);
+ Tcl_StatBuf *\fIstatPtr\fR);
.CE
.PP
The \fBTcl_FSStatProc\fR fills the stat structure \fIstatPtr\fR with
@@ -1071,7 +1080,7 @@ it need only be implemented if a filesystem can differentiate between
.CS
typedef int Tcl_FSLstatProc(
Tcl_Obj *\fIpathPtr\fR,
- struct stat *\fIstatPtr\fR);
+ Tcl_StatBuf *\fIstatPtr\fR);
.CE
.PP
The behavior of this function is very similar to that of the
@@ -1221,5 +1230,3 @@ directory to the value specified in \fIpathPtr\fR. The function returns
.SH KEYWORDS
stat access filesystem vfs
-
-
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 81fdec8..c7ead11 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tcl.decls,v 1.58.2.1 2001/09/24 15:46:50 dkf Exp $
+# RCS: @(#) $Id: tcl.decls,v 1.58.2.2 2001/09/25 10:24:06 dkf Exp $
library tcl
@@ -1300,7 +1300,7 @@ declare 367 generic {
int Tcl_Access(CONST char *path, int mode)
}
declare 368 generic {
- int Tcl_Stat(CONST char *path, struct stat *bufPtr)
+ int Tcl_Stat(CONST char *path, Tcl_StatBuf *bufPtr)
}
declare 369 generic {
int Tcl_UtfNcmp(CONST char *s1, CONST char *s2, Tcl_Length n)
@@ -1587,7 +1587,7 @@ declare 448 generic {
int Tcl_FSRenameFile(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr)
}
declare 449 generic {
- int Tcl_FSLstat(Tcl_Obj *pathPtr, struct stat *buf)
+ int Tcl_FSLstat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf)
}
declare 450 generic {
int Tcl_FSUtime(Tcl_Obj *pathPtr, struct utimbuf *tval)
@@ -1606,7 +1606,7 @@ declare 453 generic {
char** Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef)
}
declare 454 generic {
- int Tcl_FSStat(Tcl_Obj *pathPtr, struct stat *buf)
+ int Tcl_FSStat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf)
}
declare 455 generic {
int Tcl_FSAccess(Tcl_Obj *pathPtr, int mode)
@@ -1692,7 +1692,26 @@ declare 480 generic {
declare 481 generic {
int Tcl_EvalTokensStandard(Tcl_Interp *interp, Tcl_Token *tokenPtr, int count)
}
-
+
+### New functions on 64-bit dev branch ###
+declare 482 generic {
+ Tcl_Obj * Tcl_DbNewWideIntObj(Tcl_WideInt wideValue,
+ CONST char *file, int line)
+}
+declare 483 generic {
+ int Tcl_GetWideIntFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
+ Tcl_WideInt *widePtr)
+}
+declare 484 generic {
+ Tcl_Obj * Tcl_NewWideIntObj(Tcl_WideInt wideValue)
+}
+declare 485 generic {
+ void Tcl_SetWideIntObj(Tcl_Obj *objPtr, Tcl_WideInt wideValue)
+}
+declare 486 generic {
+ Tcl_StatBuf * Tcl_AllocStatBuf(void)
+}
+
##############################################################################
# Define the platform specific public Tcl interface. These functions are
diff --git a/generic/tcl.h b/generic/tcl.h
index 8744584..7fee16f 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.102.2.1 2001/09/24 15:46:50 dkf Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.102.2.2 2001/09/25 10:24:06 dkf Exp $
*/
#ifndef _TCL
@@ -173,6 +173,16 @@ extern "C" {
#ifndef RESOURCE_INCLUDED
+/*
+ * Must define _before_ any #include of system headers...
+ */
+#define _LARGEFILE64_SOURCE 1
+/*
+ * *Not* the following definition...
+ *
+ * #define _LARGEFILE_SOURCE 1
+ */
+
#ifndef BUFSIZ
#include <stdio.h>
#endif
@@ -333,9 +343,9 @@ typedef long LONG;
/*
* Type of 64-bit values on 32-bit systems. FIXME - DKF
*/
-typedef Tcl_WideInt long long;
-typedef Tcl_Length unsigned int;
-typedef Tcl_StatBuf struct stat;
+typedef long long Tcl_WideInt;
+typedef unsigned int Tcl_Length;
+typedef struct stat64 Tcl_StatBuf;
/*
* This flag controls whether binary compatability is maintained with
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 1645ad3..0fa3bd9 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdAH.c,v 1.16 2001/09/20 01:03:08 hobbs Exp $
+ * RCS: @(#) $Id: tclCmdAH.c,v 1.16.2.1 2001/09/25 10:24:06 dkf Exp $
*/
#include "tclInt.h"
@@ -26,10 +26,10 @@ static int CheckAccess _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, int mode));
static int GetStatBuf _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, Tcl_FSStatProc *statProc,
- struct stat *statPtr));
+ Tcl_StatBuf *statPtr));
static char * GetTypeFromMode _ANSI_ARGS_((int mode));
static int StoreStatData _ANSI_ARGS_((Tcl_Interp *interp,
- char *varName, struct stat *statPtr));
+ char *varName, Tcl_StatBuf *statPtr));
/*
*----------------------------------------------------------------------
@@ -823,7 +823,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
switch ((enum options) index) {
case FILE_ATIME: {
- struct stat buf;
+ Tcl_StatBuf buf;
struct utimbuf tval;
if ((objc < 3) || (objc > 4)) {
@@ -917,7 +917,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
case FILE_ISDIRECTORY: {
int value;
- struct stat buf;
+ Tcl_StatBuf buf;
if (objc != 3) {
goto only3Args;
@@ -931,7 +931,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
case FILE_ISFILE: {
int value;
- struct stat buf;
+ Tcl_StatBuf buf;
if (objc != 3) {
goto only3Args;
@@ -956,7 +956,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
case FILE_LSTAT: {
char *varName;
- struct stat buf;
+ Tcl_StatBuf buf;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "name varName");
@@ -969,7 +969,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
return StoreStatData(interp, varName, &buf);
}
case FILE_MTIME: {
- struct stat buf;
+ Tcl_StatBuf buf;
struct utimbuf tval;
if ((objc < 3) || (objc > 4)) {
@@ -1044,7 +1044,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
case FILE_OWNED: {
int value;
- struct stat buf;
+ Tcl_StatBuf buf;
if (objc != 3) {
goto only3Args;
@@ -1164,7 +1164,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
return TCL_OK;
}
case FILE_SIZE: {
- struct stat buf;
+ Tcl_StatBuf buf;
if (objc != 3) {
goto only3Args;
@@ -1184,7 +1184,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
case FILE_STAT: {
char *varName;
- struct stat buf;
+ Tcl_StatBuf buf;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 1, objv, "stat name varName");
@@ -1253,7 +1253,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
return TCL_OK;
}
case FILE_TYPE: {
- struct stat buf;
+ Tcl_StatBuf buf;
if (objc != 3) {
goto only3Args;
@@ -1350,7 +1350,7 @@ GetStatBuf(interp, objPtr, statProc, statPtr)
Tcl_Obj *objPtr; /* Path name to examine. */
Tcl_FSStatProc *statProc; /* Either stat() or lstat() depending on
* desired behavior. */
- struct stat *statPtr; /* Filled with info about file obtained by
+ Tcl_StatBuf *statPtr; /* Filled with info about file obtained by
* calling (*statProc)(). */
{
int status;
@@ -1396,7 +1396,7 @@ StoreStatData(interp, varName, statPtr)
Tcl_Interp *interp; /* Interpreter for error reports. */
char *varName; /* Name of associative array variable
* in which to store stat results. */
- struct stat *statPtr; /* Pointer to buffer containing
+ Tcl_StatBuf *statPtr; /* Pointer to buffer containing
* stat data to store in varName. */
{
char string[TCL_INTEGER_SPACE];
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index 042fe79..7d3b7e5 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclFCmd.c,v 1.13 2001/09/08 14:05:09 vincentdarley Exp $
+ * RCS: @(#) $Id: tclFCmd.c,v 1.13.6.1 2001/09/25 10:24:07 dkf Exp $
*/
#include "tclInt.h"
@@ -111,7 +111,7 @@ FileCopyRename(interp, objc, objv, copyFlag)
* rename them. */
{
int i, result, force;
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
Tcl_Obj *target;
i = FileForceOption(interp, objc - 2, objv + 2, &force);
@@ -229,7 +229,7 @@ TclFileMakeDirsCmd(interp, objc, objv)
int result, i, j, pobjc;
Tcl_Obj *split = NULL;
Tcl_Obj *target = NULL;
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
errfile = NULL;
@@ -333,7 +333,7 @@ TclFileDeleteCmd(interp, objc, objv)
result = TCL_OK;
for ( ; i < objc; i++) {
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
errfile = objv[i];
if (Tcl_FSConvertToPathType(interp, objv[i]) != TCL_OK) {
@@ -448,7 +448,7 @@ CopyRenameOneFile(interp, source, target, copyFlag, force)
{
int result;
Tcl_Obj *errfile, *errorBuffer;
- struct stat sourceStatBuf, targetStatBuf;
+ Tcl_StatBuf sourceStatBuf, targetStatBuf;
if (Tcl_FSConvertToPathType(interp, source) != TCL_OK) {
return TCL_ERROR;
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 3eb9a17..d19389d 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclFileName.c,v 1.20 2001/09/04 18:06:34 vincentdarley Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.20.6.1 2001/09/25 10:24:07 dkf Exp $
*/
#include "tclInt.h"
@@ -688,7 +688,6 @@ SplitUnixPath(path)
}
return result;
}
-
/*
*----------------------------------------------------------------------
@@ -2485,7 +2484,7 @@ TclDoGlob(interp, separators, headPtr, tail, types)
*/
Tcl_Obj *nameObj;
- struct stat buf;
+ Tcl_StatBuf buf;
/* Used to deal with one special case pertinent to MacOS */
int macSpecialCase = 0;
@@ -2549,7 +2548,6 @@ TclDoGlob(interp, separators, headPtr, tail, types)
return TCL_OK;
}
}
-
/*
*---------------------------------------------------------------------------
@@ -2615,3 +2613,27 @@ TclFileDirname(interp, pathPtr)
Tcl_DecrRefCount(splitPtr);
return splitResultPtr;
}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tcl_AllocStatBuf
+ *
+ * This procedure allocates a Tcl_StatBuf on the heap. It exists
+ * so that extensions may be used unchanged on systems where
+ * largefile support is optional.
+ *
+ * Results:
+ * A pointer to a Tcl_StatBuf which may be deallocated by being
+ * passed to ckfree().
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+Tcl_StatBuf *
+Tcl_AllocStatBuf() {
+ return (Tcl_StatBuf *) ckalloc(sizeof(Tcl_StatBuf));
+}
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 771b139..ded08bc 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.20 2001/09/08 14:05:09 vincentdarley Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.20.6.1 2001/09/25 10:24:07 dkf Exp $
*/
#include "tclInt.h"
@@ -79,7 +79,7 @@ extern CONST TclFileAttrProcs tclpFileAttrProcs[];
int
Tcl_Stat(path, buf)
CONST char *path; /* Path of file to stat (in current CP). */
- struct stat *buf; /* Filled with results of stat call. */
+ Tcl_StatBuf *buf; /* Filled with results of stat call. */
{
int ret;
Tcl_Obj *pathPtr = Tcl_NewStringObj(path,-1);
@@ -1147,7 +1147,7 @@ Tcl_FSEvalFile(interp, fileName)
* will be performed on this name. */
{
int result, length;
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
Tcl_Obj *oldScriptFile;
Interp *iPtr;
char *string;
@@ -1331,7 +1331,7 @@ Tcl_PosixError(interp)
int
Tcl_FSStat(pathPtr, buf)
Tcl_Obj *pathPtr; /* Path of file to stat (in current CP). */
- struct stat *buf; /* Filled with results of stat call. */
+ Tcl_StatBuf *buf; /* Filled with results of stat call. */
{
Tcl_Filesystem *fsPtr;
#ifdef USE_OBSOLETE_FS_HOOKS
@@ -1397,7 +1397,7 @@ Tcl_FSStat(pathPtr, buf)
int
Tcl_FSLstat(pathPtr, buf)
Tcl_Obj *pathPtr; /* Path of file to stat (in current CP). */
- struct stat *buf; /* Filled with results of stat call. */
+ Tcl_StatBuf *buf; /* Filled with results of stat call. */
{
Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
if (fsPtr != NULL) {
@@ -2170,7 +2170,7 @@ Tcl_FSChdir(pathPtr)
retVal = (*proc)(pathPtr);
} else {
/* Fallback on stat-based implementation */
- struct stat buf;
+ Tcl_StatBuf buf;
/* If the file can be stat'ed and is a directory and
* is readable, then we can chdir. */
if ((Tcl_FSStat(pathPtr, &buf) == 0)
@@ -3028,7 +3028,7 @@ TclCrossFilesystemCopy(interp, source, target)
/* This is very strange, we checked this above */
Tcl_Close(interp, out);
} else {
- struct stat sourceStatBuf;
+ Tcl_StatBuf sourceStatBuf;
struct utimbuf tval;
/*
* Copy it synchronously. We might wish to add an
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index ef88533..25957b7 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tclInt.decls,v 1.31 2001/09/10 17:17:41 andreas_kupries Exp $
+# RCS: @(#) $Id: tclInt.decls,v 1.31.4.1 2001/09/25 10:24:07 dkf Exp $
library tcl
@@ -274,7 +274,7 @@ declare 67 generic {
# int TclpAccess(CONST char *path, int mode)
#}
declare 69 generic {
- char * TclpAlloc(unsigned int size)
+ char * TclpAlloc(Tcl_Length size)
}
#declare 70 generic {
# int TclpCopyFile(CONST char *source, CONST char *dest)
@@ -314,7 +314,7 @@ declare 78 generic {
# char *modeString, int permissions)
#}
declare 81 generic {
- char * TclpRealloc(char *ptr, unsigned int size)
+ char * TclpRealloc(char *ptr, Tcl_Length size)
}
#declare 82 generic {
# int TclpRemoveDirectory(CONST char *path, int recursive, \
@@ -368,7 +368,7 @@ declare 94 generic {
}
# Replaced by Tcl_FSStat in 8.4:
#declare 95 generic {
-# int TclpStat(CONST char *path, struct stat *buf)
+# int TclpStat(CONST char *path, Tcl_StatBuf *buf)
#}
declare 96 generic {
int TclRenameCommand(Tcl_Interp *interp, char *oldName, char *newName)
@@ -402,7 +402,7 @@ declare 104 {unix win} {
}
# Replaced by Tcl_FSStat in 8.4:
#declare 105 generic {
-# int TclStat(CONST char *path, struct stat *buf)
+# int TclStat(CONST char *path, Tcl_StatBuf *buf)
#}
declare 106 generic {
int TclStatDeleteProc(TclStatProc_ *proc)
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 5565338..3f8aa50 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInt.h,v 1.64 2001/09/08 14:05:09 vincentdarley Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.64.6.1 2001/09/25 10:24:07 dkf Exp $
*/
#ifndef _TCLINT
@@ -752,7 +752,7 @@ EXTERN void TclHandleRelease _ANSI_ARGS_((TclHandle handle));
typedef struct {
char *command; /* String containing previously-executed
* command. */
- int bytesAvl; /* Total # of bytes available at *event (not
+ Tcl_Length bytesAvl; /* Total # of bytes available at *event (not
* all are necessarily in use now). */
} HistoryEvent;
@@ -764,11 +764,11 @@ typedef struct {
*/
typedef struct HistoryRev {
- int firstIndex; /* Index of the first byte to replace in
+ Tcl_Length firstIndex; /* Index of the first byte to replace in
* current history event. */
- int lastIndex; /* Index of last byte to replace in
+ Tcl_Length lastIndex; /* Index of last byte to replace in
* current history event. */
- int newSize; /* Number of bytes in newBytes. */
+ Tcl_Length newSize; /* Number of bytes in newBytes. */
char *newBytes; /* Replacement for the range given by
* firstIndex and lastIndex (malloced). */
struct HistoryRev *nextPtr; /* Next in chain of revisions to apply, or
@@ -1185,7 +1185,7 @@ typedef struct Interp {
/*
* Information related to procedures and variables. See tclProc.c
- * and tclvar.c for usage.
+ * and tclVar.c for usage.
*/
int numLevels; /* Keeps track of how many nested calls to
@@ -1222,9 +1222,9 @@ typedef struct Interp {
char *appendResult; /* Storage space for results generated
* by Tcl_AppendResult. Malloc-ed. NULL
* means not yet allocated. */
- int appendAvl; /* Total amount of space available at
+ Tcl_Length appendAvl; /* Total amount of space available at
* partialResult. */
- int appendUsed; /* Number of non-null bytes currently
+ Tcl_Length appendUsed; /* Number of non-null bytes currently
* stored at partialResult. */
/*
@@ -1524,7 +1524,7 @@ typedef struct TclpTime_t_ *TclpTime_t;
*----------------------------------------------------------------
*/
-typedef int (TclStatProc_) _ANSI_ARGS_((CONST char *path, struct stat *buf));
+typedef int (TclStatProc_) _ANSI_ARGS_((CONST char *path, Tcl_StatBuf *buf));
typedef int (TclAccessProc_) _ANSI_ARGS_((CONST char *path, int mode));
typedef Tcl_Channel (TclOpenFileChannelProc_) _ANSI_ARGS_((Tcl_Interp *interp,
char *fileName, char *modeString,
@@ -1770,8 +1770,8 @@ EXTERN int TclOpenFileChannelInsertProc _ANSI_ARGS_((
EXTERN int TclpObjAccess _ANSI_ARGS_((Tcl_Obj *filename,
int mode));
EXTERN int TclpObjLstat _ANSI_ARGS_((Tcl_Obj *pathPtr,
- struct stat *buf));
-EXTERN char * TclpAlloc _ANSI_ARGS_((unsigned int size));
+ Tcl_StatBuf *buf));
+EXTERN char * TclpAlloc _ANSI_ARGS_((Tcl_Length size));
EXTERN int TclpCheckStackSpace _ANSI_ARGS_((void));
EXTERN Tcl_Obj* TclpTempFileName _ANSI_ARGS_((void));
EXTERN void TclpExit _ANSI_ARGS_((int status));
@@ -1840,7 +1840,7 @@ EXTERN Tcl_Obj* TclpObjLink _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_Obj *toPtr));
EXTERN int TclpObjChdir _ANSI_ARGS_((Tcl_Obj *pathPtr));
EXTERN Tcl_Obj* TclFileDirname _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj*pathPtr));
-EXTERN int TclpObjStat _ANSI_ARGS_((Tcl_Obj *pathPtr, struct stat *buf));
+EXTERN int TclpObjStat _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_StatBuf *buf));
EXTERN Tcl_Channel TclpOpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *pathPtr, char *modeString,
int permissions));
@@ -1849,7 +1849,7 @@ EXTERN void TclpPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *,
EXTERN char * TclpReadlink _ANSI_ARGS_((CONST char *fileName,
Tcl_DString *linkPtr));
EXTERN char * TclpRealloc _ANSI_ARGS_((char *ptr,
- unsigned int size));
+ Tcl_Length size));
EXTERN void TclpReleaseFile _ANSI_ARGS_((TclFile file));
EXTERN void TclpSetInitialEncodings _ANSI_ARGS_((void));
EXTERN void TclpSetVariables _ANSI_ARGS_((Tcl_Interp *interp));
diff --git a/generic/tclTest.c b/generic/tclTest.c
index e1f7cdb..212c8fd 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTest.c,v 1.31 2001/09/20 01:00:10 hobbs Exp $
+ * RCS: @(#) $Id: tclTest.c,v 1.31.2.1 2001/09/25 10:24:07 dkf Exp $
*/
#define TCL_TEST
@@ -284,13 +284,13 @@ static int TestsetrecursionlimitCmd _ANSI_ARGS_((
static int TeststaticpkgCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, char **argv));
static int PretendTclpStat _ANSI_ARGS_((CONST char *path,
- struct stat *buf));
+ Tcl_StatBuf *buf));
static int TestStatProc1 _ANSI_ARGS_((CONST char *path,
- struct stat *buf));
+ Tcl_StatBuf *buf));
static int TestStatProc2 _ANSI_ARGS_((CONST char *path,
- struct stat *buf));
+ Tcl_StatBuf *buf));
static int TestStatProc3 _ANSI_ARGS_((CONST char *path,
- struct stat *buf));
+ Tcl_StatBuf *buf));
static int TeststatprocCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int argc, char **argv));
static int TesttranslatefilenameCmd _ANSI_ARGS_((ClientData dummy,
@@ -4085,7 +4085,7 @@ TeststatprocCmd (dummy, interp, argc, argv)
static int PretendTclpStat(path, buf)
CONST char *path;
- struct stat *buf;
+ Tcl_StatBuf *buf;
{
int ret;
Tcl_Obj *pathPtr = Tcl_NewStringObj(path, -1);
@@ -4103,7 +4103,7 @@ static int PretendTclpStat(path, buf)
static int
TestStatProc1(path, buf)
CONST char *path;
- struct stat *buf;
+ Tcl_StatBuf *buf;
{
buf->st_size = 1234;
return ((strstr(path, "testStat1%.fil") == NULL) ? -1 : 0);
@@ -4113,7 +4113,7 @@ TestStatProc1(path, buf)
static int
TestStatProc2(path, buf)
CONST char *path;
- struct stat *buf;
+ Tcl_StatBuf *buf;
{
buf->st_size = 2345;
return ((strstr(path, "testStat2%.fil") == NULL) ? -1 : 0);
@@ -4123,7 +4123,7 @@ TestStatProc2(path, buf)
static int
TestStatProc3(path, buf)
CONST char *path;
- struct stat *buf;
+ Tcl_StatBuf *buf;
{
buf->st_size = 3456;
return ((strstr(path, "testStat3%.fil") == NULL) ? -1 : 0);
@@ -5340,7 +5340,7 @@ TestReport(cmd, path, arg2)
static int
TestReportStat(path, buf)
Tcl_Obj *path; /* Path of file to stat (in current CP). */
- struct stat *buf; /* Filled with results of stat call. */
+ Tcl_StatBuf *buf; /* Filled with results of stat call. */
{
TestReport("stat",path, NULL);
return Tcl_FSStat(TestReportGetNativePath(path),buf);
@@ -5348,7 +5348,7 @@ TestReportStat(path, buf)
static int
TestReportLstat(path, buf)
Tcl_Obj *path; /* Path of file to stat (in current CP). */
- struct stat *buf; /* Filled with results of stat call. */
+ Tcl_StatBuf *buf; /* Filled with results of stat call. */
{
TestReport("lstat",path, NULL);
return Tcl_FSLstat(TestReportGetNativePath(path),buf);
diff --git a/mac/tclMacFile.c b/mac/tclMacFile.c
index cb85d59..00a88dd 100644
--- a/mac/tclMacFile.c
+++ b/mac/tclMacFile.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacFile.c,v 1.12 2001/08/30 08:53:15 vincentdarley Exp $
+ * RCS: @(#) $Id: tclMacFile.c,v 1.12.6.1 2001/09/25 10:24:07 dkf Exp $
*/
/*
@@ -253,7 +253,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
typeOk = 0;
}
} else {
- struct stat buf;
+ Tcl_StatBuf buf;
if (pb.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible) {
/* If invisible */
@@ -728,7 +728,7 @@ TclpReadlink(
int
TclpObjLstat(pathPtr, buf)
Tcl_Obj *pathPtr;
- struct stat *buf;
+ Tcl_StatBuf *buf;
{
/* This needs to be enhanced to deal with aliases */
return TclpObjStat(pathPtr, buf);
@@ -753,7 +753,7 @@ TclpObjLstat(pathPtr, buf)
int
TclpObjStat(pathPtr, bufPtr)
Tcl_Obj *pathPtr;
- struct stat *bufPtr;
+ Tcl_StatBuf *bufPtr;
{
HFileInfo fpb;
HVolumeParam vpb;
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 98d5224..b1f0651 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFCmd.c,v 1.12 2001/09/04 18:06:34 vincentdarley Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.12.6.1 2001/09/25 10:24:07 dkf Exp $
*
* Portions of this code were derived from NetBSD source code which has
* the following copyright notice:
@@ -97,7 +97,7 @@ static int GetModeFromPermString _ANSI_ARGS_((
*/
typedef int (TraversalProc) _ANSI_ARGS_((Tcl_DString *srcPtr,
- Tcl_DString *dstPtr, CONST struct stat *statBufPtr, int type,
+ Tcl_DString *dstPtr, CONST Tcl_StatBuf *statBufPtr, int type,
Tcl_DString *errorPtr));
/*
@@ -128,9 +128,9 @@ CONST TclFileAttrProcs tclpFileAttrProcs[] = {
*/
static int CopyFile _ANSI_ARGS_((CONST char *src,
- CONST char *dst, CONST struct stat *statBufPtr));
+ CONST char *dst, CONST Tcl_StatBuf *statBufPtr));
static int CopyFileAtts _ANSI_ARGS_((CONST char *src,
- CONST char *dst, CONST struct stat *statBufPtr));
+ CONST char *dst, CONST Tcl_StatBuf *statBufPtr));
static int DoCopyFile _ANSI_ARGS_((CONST char *srcPtr,
CONST char *dstPtr));
static int DoCreateDirectory _ANSI_ARGS_((CONST char *pathPtr));
@@ -140,10 +140,10 @@ static int DoRemoveDirectory _ANSI_ARGS_((Tcl_DString *pathPtr,
static int DoRenameFile _ANSI_ARGS_((CONST char *src,
CONST char *dst));
static int TraversalCopy _ANSI_ARGS_((Tcl_DString *srcPtr,
- Tcl_DString *dstPtr, CONST struct stat *statBufPtr,
+ Tcl_DString *dstPtr, CONST Tcl_StatBuf *statBufPtr,
int type, Tcl_DString *errorPtr));
static int TraversalDelete _ANSI_ARGS_((Tcl_DString *srcPtr,
- Tcl_DString *dstPtr, CONST struct stat *statBufPtr,
+ Tcl_DString *dstPtr, CONST Tcl_StatBuf *statBufPtr,
int type, Tcl_DString *errorPtr));
static int TraverseUnixTree _ANSI_ARGS_((
TraversalProc *traversalProc,
@@ -317,7 +317,7 @@ DoCopyFile(src, dst)
CONST char *src; /* Pathname of file to be copied (native). */
CONST char *dst; /* Pathname of file to copy to (native). */
{
- struct stat srcStatBuf, dstStatBuf;
+ Tcl_StatBuf srcStatBuf, dstStatBuf;
/*
* Have to do a stat() to determine the filetype.
@@ -406,7 +406,7 @@ CopyFile(src, dst, statBufPtr)
CONST char *src; /* Pathname of file to copy (native). */
CONST char *dst; /* Pathname of file to create/overwrite
* (native). */
- CONST struct stat *statBufPtr;
+ CONST Tcl_StatBuf *statBufPtr;
/* Used to determine mode and blocksize. */
{
int srcFd;
@@ -431,6 +431,13 @@ CopyFile(src, dst, statBufPtr)
#else
#ifndef NO_FSTATFS
{
+ /*
+ * *=*=* WARNING: SOLARIS HEADERS SAY statfs IS OBSOLETE! *=*=*
+ *
+ * This would not be a problem if it wasn't for the fact that
+ * its replacement - statvfs - requires attention when working
+ * with largefile support. - DKF
+ */
struct statfs fs;
if (fstatfs(srcFd, &fs, sizeof(fs), 0) == 0) {
blockSize = fs.f_bsize;
@@ -692,7 +699,7 @@ DoRemoveDirectory(pathPtr, recursive, errorPtr)
if (recursive != 0) {
/* We should try to change permissions so this can be deleted */
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
int newPerm;
if (stat(path, &statBuf) == 0) {
@@ -768,7 +775,7 @@ TraverseUnixTree(traverseProc, sourcePtr, targetPtr, errorPtr)
* DString filled with UTF-8 name of file
* causing error. */
{
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
CONST char *source, *errfile;
int result, sourceLen;
int targetLen;
@@ -898,7 +905,7 @@ static int
TraversalCopy(srcPtr, dstPtr, statBufPtr, type, errorPtr)
Tcl_DString *srcPtr; /* Source pathname to copy (native). */
Tcl_DString *dstPtr; /* Destination pathname of copy (native). */
- CONST struct stat *statBufPtr;
+ CONST Tcl_StatBuf *statBufPtr;
/* Stat info for file specified by srcPtr. */
int type; /* Reason for call - see TraverseUnixTree(). */
Tcl_DString *errorPtr; /* If non-NULL, uninitialized or free
@@ -963,7 +970,7 @@ static int
TraversalDelete(srcPtr, ignore, statBufPtr, type, errorPtr)
Tcl_DString *srcPtr; /* Source pathname (native). */
Tcl_DString *ignore; /* Destination pathname (not used). */
- CONST struct stat *statBufPtr;
+ CONST Tcl_StatBuf *statBufPtr;
/* Stat info for file specified by srcPtr. */
int type; /* Reason for call - see TraverseUnixTree(). */
Tcl_DString *errorPtr; /* If non-NULL, uninitialized or free
@@ -1017,7 +1024,7 @@ static int
CopyFileAtts(src, dst, statBufPtr)
CONST char *src; /* Path name of source file (native). */
CONST char *dst; /* Path name of target file (native). */
- CONST struct stat *statBufPtr;
+ CONST Tcl_StatBuf *statBufPtr;
/* Stat info for source file */
{
struct utimbuf tval;
@@ -1076,7 +1083,7 @@ GetGroupAttribute(interp, objIndex, fileName, attributePtrPtr)
Tcl_Obj *fileName; /* The name of the file (UTF-8). */
Tcl_Obj **attributePtrPtr; /* A pointer to return the object with. */
{
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
struct group *groupPtr;
int result;
@@ -1128,7 +1135,7 @@ GetOwnerAttribute(interp, objIndex, fileName, attributePtrPtr)
Tcl_Obj *fileName; /* The name of the file (UTF-8). */
Tcl_Obj **attributePtrPtr; /* A pointer to return the object with. */
{
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
struct passwd *pwPtr;
int result;
@@ -1180,7 +1187,7 @@ GetPermissionsAttribute(interp, objIndex, fileName, attributePtrPtr)
Tcl_Obj *fileName; /* The name of the file (UTF-8). */
Tcl_Obj **attributePtrPtr; /* A pointer to return the object with. */
{
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
char returnString[7];
int result;
@@ -1358,7 +1365,7 @@ SetPermissionsAttribute(interp, objIndex, fileName, attributePtr)
if (Tcl_GetLongFromObj(NULL, attributePtr, &mode) == TCL_OK) {
newMode = (mode_t) (mode & 0x00007FFF);
} else {
- struct stat buf;
+ Tcl_StatBuf buf;
char *modeStringPtr = Tcl_GetString(attributePtr);
/*
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index befa699..7a01d0e 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFile.c,v 1.12 2001/08/30 08:53:15 vincentdarley Exp $
+ * RCS: @(#) $Id: tclUnixFile.c,v 1.12.6.1 2001/09/25 10:24:07 dkf Exp $
*/
#include "tclInt.h"
@@ -46,7 +46,7 @@ TclpFindExecutable(argv0)
* (native). */
{
CONST char *name, *p;
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
int length;
Tcl_DString buffer, nameString;
@@ -111,13 +111,13 @@ TclpFindExecutable(argv0)
name = Tcl_DStringAppend(&buffer, argv0, -1);
/*
- * INTL: The following calls to access() and stat() should not be
+ * INTL: The following calls to access() and stat64() should not be
* converted to Tclp routines because they need to operate on native
* strings directly.
*/
- if ((access(name, X_OK) == 0) /* INTL: Native. */
- && (stat(name, &statBuf) == 0) /* INTL: Native. */
+ if ((access(name, X_OK) == 0) /* INTL: Native. */
+ && (stat64(name, &statBuf) == 0) /* INTL: Native. */
&& S_ISREG(statBuf.st_mode)) {
goto gotName;
}
@@ -204,7 +204,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
char *native, *fname, *dirName;
DIR *d;
Tcl_DString ds;
- struct stat statBuf;
+ Tcl_StatBuf statBuf;
int matchHidden;
int nativeDirLen;
int result = TCL_OK;
@@ -257,7 +257,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
native = Tcl_UtfToExternalDString(NULL, dirName, -1, &ds);
- if ((stat(native, &statBuf) != 0) /* INTL: UTF-8. */
+ if ((stat64(native, &statBuf) != 0) /* INTL: UTF-8. */
|| !S_ISDIR(statBuf.st_mode)) {
Tcl_DStringFree(&dsOrig);
Tcl_DStringFree(&ds);
@@ -331,7 +331,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
Tcl_DStringAppend(&dsOrig, utf, -1);
fname = Tcl_DStringValue(&dsOrig);
if (types != NULL) {
- struct stat buf;
+ Tcl_StatBuf buf;
char *nativeEntry;
Tcl_DStringSetLength(&ds, nativeDirLen);
Tcl_DStringAppend(&ds, entryPtr->d_name, -1);
@@ -342,13 +342,13 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
*/
if (types->perm != 0) {
- if (stat(nativeEntry, &buf) != 0) {
+ if (stat64(nativeEntry, &buf) != 0) {
/*
* Either the file has disappeared between the
- * 'readdir' call and the 'stat' call, or
+ * 'readdir' call and the 'stat64' call, or
* the file is a link to a file which doesn't
* exist (which we could ascertain with
- * lstat), or there is some other strange
+ * lstat64), or there is some other strange
* problem. In all these cases, we define this
* to mean the file does not match any defined
* permission, and therefore it is not
@@ -376,8 +376,8 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
}
if (typeOk && (types->type != 0)) {
if (types->perm == 0) {
- /* We haven't yet done a stat on the file */
- if (stat(nativeEntry, &buf) != 0) {
+ /* We haven't yet done a stat64 on the file */
+ if (stat64(nativeEntry, &buf) != 0) {
/* Posix error occurred */
typeOk = 0;
}
@@ -407,7 +407,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
typeOk = 0;
#ifdef S_ISLNK
if (types->type & TCL_GLOB_TYPE_LINK) {
- if (lstat(nativeEntry, &buf) == 0) {
+ if (lstat64(nativeEntry, &buf) == 0) {
if (S_ISLNK(buf.st_mode)) {
typeOk = 1;
}
@@ -538,13 +538,13 @@ TclpObjChdir(pathPtr)
*
* TclpObjLstat --
*
- * This function replaces the library version of lstat().
+ * This function replaces the library version of lstat64().
*
* Results:
- * See lstat() documentation.
+ * See lstat64() documentation.
*
* Side effects:
- * See lstat() documentation.
+ * See lstat64() documentation.
*
*----------------------------------------------------------------------
*/
@@ -552,13 +552,13 @@ TclpObjChdir(pathPtr)
int
TclpObjLstat(pathPtr, bufPtr)
Tcl_Obj *pathPtr; /* Path of file to stat */
- struct stat *bufPtr; /* Filled with results of stat call. */
+ Tcl_StatBuf *bufPtr; /* Filled with results of stat call. */
{
char *path = Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
} else {
- return lstat(path, bufPtr);
+ return lstat64(path, bufPtr);
}
}
@@ -670,13 +670,13 @@ TclpReadlink(path, linkPtr)
*
* TclpObjStat --
*
- * This function replaces the library version of stat().
+ * This function replaces the library version of stat64().
*
* Results:
- * See stat() documentation.
+ * See stat64() documentation.
*
* Side effects:
- * See stat() documentation.
+ * See stat64() documentation.
*
*----------------------------------------------------------------------
*/
@@ -684,13 +684,13 @@ TclpReadlink(path, linkPtr)
int
TclpObjStat(pathPtr, bufPtr)
Tcl_Obj *pathPtr; /* Path of file to stat */
- struct stat *bufPtr; /* Filled with results of stat call. */
+ Tcl_StatBuf *bufPtr; /* Filled with results of stat call. */
{
char *path = Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
} else {
- return stat(path, bufPtr);
+ return stat64(path, bufPtr);
}
}
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 1cce9fd..57406b9 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinFile.c,v 1.15 2001/09/10 17:17:41 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclWinFile.c,v 1.15.4.1 2001/09/25 10:24:07 dkf Exp $
*/
#include "tclWinInt.h"
@@ -31,7 +31,7 @@ typedef NET_API_STATUS NET_API_FUNCTION NETGETDCNAMEPROC
(LPWSTR servername, LPWSTR domainname, LPBYTE *bufptr);
static int NativeAccess(TCHAR *path, int mode);
-static int NativeStat(TCHAR *path, struct stat *statPtr);
+static int NativeStat(TCHAR *path, Tcl_StatBuf *statPtr);
static int NativeIsExec(TCHAR *path);
@@ -338,7 +338,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
typeOk = 0;
}
} else {
- struct stat buf;
+ Tcl_StatBuf buf;
if (attr & FILE_ATTRIBUTE_HIDDEN) {
/* If invisible */
@@ -828,7 +828,7 @@ TclpGetCwd(interp, bufferPtr)
int
TclpObjStat(pathPtr, statPtr)
Tcl_Obj *pathPtr; /* Path of file to stat */
- struct stat *statPtr; /* Filled with results of stat call. */
+ Tcl_StatBuf *statPtr; /* Filled with results of stat call. */
{
Tcl_Obj *transPtr;
/*
@@ -879,7 +879,7 @@ TclpObjStat(pathPtr, statPtr)
static int
NativeStat(nativePath, statPtr)
TCHAR *nativePath; /* Path of file to stat */
- struct stat *statPtr; /* Filled with results of stat call. */
+ Tcl_StatBuf *statPtr; /* Filled with results of stat call. */
{
Tcl_DString ds;
WIN32_FIND_DATAT data;
@@ -1143,7 +1143,7 @@ TclpObjAccess(pathPtr, mode)
int
TclpObjLstat(pathPtr, buf)
Tcl_Obj *pathPtr;
- struct stat *buf;
+ Tcl_StatBuf *buf;
{
return TclpObjStat(pathPtr,buf);
}