diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWin32Dll.c | 4 | ||||
-rw-r--r-- | win/tclWinFile.c | 36 | ||||
-rw-r--r-- | win/tclWinInt.h | 5 |
3 files changed, 42 insertions, 3 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 506cf78..038cf83 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.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: tclWin32Dll.c,v 1.18 2002/12/06 23:22:59 hobbs Exp $ + * RCS: @(#) $Id: tclWin32Dll.c,v 1.19 2003/01/09 10:38:34 vincentdarley Exp $ */ #include "tclWinInt.h" @@ -92,6 +92,7 @@ static TclWinProcs asciiProcs = { */ NULL, NULL, + (int (__cdecl*)(CONST TCHAR *, struct _utimbuf *)) _utime, }; static TclWinProcs unicodeProcs = { @@ -138,6 +139,7 @@ static TclWinProcs unicodeProcs = { */ NULL, NULL, + (int (__cdecl*)(CONST TCHAR *, struct _utimbuf *)) _wutime, }; TclWinProcs *tclWinProcs; diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 04c5fa8..0023433 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.39 2002/07/20 01:01:41 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.40 2003/01/09 10:38:35 vincentdarley Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -2222,3 +2222,37 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) Tcl_DStringFree(&dsNorm); return nextCheckpoint; } + +/* + *--------------------------------------------------------------------------- + * + * TclpUtime -- + * + * Set the modification date for a file. + * + * Results: + * 0 on success, -1 on error. + * + * Side effects: + * None. + * + *--------------------------------------------------------------------------- + */ +int +TclpUtime(pathPtr, tval) + Tcl_Obj *pathPtr; /* File to modify */ + struct utimbuf *tval; /* New modification date structure */ +{ + int res; + /* + * Windows uses a slightly different structure name and, possibly, + * contents, so we have to copy the information over + */ + struct _utimbuf buf; + + buf.actime = tval->actime; + buf.modtime = tval->modtime; + + res = (*tclWinProcs->utimeProc)(Tcl_FSGetNativePath(pathPtr),&buf); + return res; +} diff --git a/win/tclWinInt.h b/win/tclWinInt.h index b6f144d..6a65f04 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinInt.h,v 1.17 2002/10/29 14:17:58 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinInt.h,v 1.18 2003/01/09 10:38:35 vincentdarley Exp $ */ #ifndef _TCLWININT @@ -100,6 +100,9 @@ typedef struct TclWinProcs { GET_FILEEX_INFO_LEVELS, LPVOID); BOOL (WINAPI *createHardLinkProc)(CONST TCHAR*, CONST TCHAR*, LPSECURITY_ATTRIBUTES); + + INT (__cdecl *utimeProc)(CONST TCHAR*, struct _utimbuf *); + } TclWinProcs; EXTERN TclWinProcs *tclWinProcs; |