summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley@noemail.net>2003-01-09 10:38:27 (GMT)
committervincentdarley <vincentdarley@noemail.net>2003-01-09 10:38:27 (GMT)
commit30e127e5b4730f78e75a5709e04e0daac2d2e1aa (patch)
tree94e33d4bbeedca7ca6ecf8cead2a25e077246a54 /mac
parentc86045135d6a9db175581cad1be75775262db703 (diff)
downloadtcl-30e127e5b4730f78e75a5709e04e0daac2d2e1aa.zip
tcl-30e127e5b4730f78e75a5709e04e0daac2d2e1aa.tar.gz
tcl-30e127e5b4730f78e75a5709e04e0daac2d2e1aa.tar.bz2
non-ascii chars in file mtime fix
FossilOrigin-Name: f53b3ba4dad59d84f37be2a959429127c30f8536
Diffstat (limited to 'mac')
-rw-r--r--mac/tclMacFile.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/mac/tclMacFile.c b/mac/tclMacFile.c
index 5e4d363..c20d056 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.25 2002/10/09 11:54:24 das Exp $
+ * RCS: @(#) $Id: tclMacFile.c,v 1.26 2003/01/09 10:38:29 vincentdarley Exp $
*/
/*
@@ -1240,3 +1240,32 @@ TclpFilesystemPathType(pathObjPtr)
/* All native paths are of the same type */
return NULL;
}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * 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 */
+{
+ long gmt_offset=TclpGetGMTOffset();
+ struct utimbuf local_tval;
+ local_tval.actime=tval->actime+gmt_offset;
+ local_tval.modtime=tval->modtime+gmt_offset;
+ return utime(Tcl_GetString(Tcl_FSGetNormalizedPath(NULL,pathPtr)),
+ &local_tval);
+}
+