Added utime() to system calls and SET-FILE-TIMES! to primitives.
authorMark Friedman <edu/mit/csail/zurich/markf>
Thu, 5 Sep 1991 22:27:17 +0000 (22:27 +0000)
committerMark Friedman <edu/mit/csail/zurich/markf>
Thu, 5 Sep 1991 22:27:17 +0000 (22:27 +0000)
v7/src/microcode/pruxfs.c
v7/src/microcode/utabmd.scm
v7/src/microcode/ux.h
v8/src/microcode/utabmd.scm

index d9e980bef9294bee04589f23d3011457f1451ef1..40338c966aa703fdb1db80b3c11c0e44d814797e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/pruxfs.c,v 9.44 1991/01/24 11:25:09 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/pruxfs.c,v 9.45 1991/09/05 22:26:48 markf Exp $
 
 Copyright (c) 1987-91 Massachusetts Institute of Technology
 
@@ -356,3 +356,20 @@ DEFUN (protect_fd, (fd), int fd)
   (*p) = fd;
   transaction_record_action (tat_always, protect_fd_close, p);
 }
+
+DEFINE_PRIMITIVE ("SET-FILE-TIMES!", Prim_set_file_times, 3, 3,
+  "Given a file name and two integers, change the access and modification \n\
+times of the file to the times represented by the two integers. \n\
+Those integers are the times in seconds since 00:00:00 GMT, Jan. 1, 1970 \n\
+The file must exist and you must be the owner (or superuser).")
+{
+  PRIMITIVE_HEADER (3);
+  {
+    struct utimbuf times;
+    
+    times.actime = arg_integer (2);
+    times.modtime = arg_integer (3);
+    STD_VOID_SYSTEM_CALL(syscall_utime, (UX_utime ((STRING_ARG (1)), &times)));
+    PRIMITIVE_RETURN (SHARP_F);
+  }
+}
index 372a41489c00b0c49e76c3d7a11a344902d28f5c..6c6c16f90a4b95f6923cba71b81d61081f3632de 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.58 1991/08/24 01:51:14 cph Exp $
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.59 1991/09/05 22:27:17 markf Exp $
 ;;;
 ;;;    Copyright (c) 1987-91 Massachusetts Institute of Technology
 ;;;
               TIME
               TIMES
               UNLINK
+              UTIME
               VFORK
               WRITE
               ))
 
 ;;; This identification string is saved by the system.
 
-"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.58 1991/08/24 01:51:14 cph Exp $"
\ No newline at end of file
+"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.59 1991/09/05 22:27:17 markf Exp $"
\ No newline at end of file
index 3b422e722a50e554872229b5207cdfbfcecdcb0c..4528702cc43182782d2a532f9add538753578f0e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.h,v 1.25 1991/08/24 02:27:37 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.h,v 1.26 1991/09/05 22:26:30 markf Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -49,6 +49,7 @@ MIT in each case. */
 #include <errno.h>
 #include <pwd.h>
 #include <grp.h>
+#include <utime.h>
 
 #include "oscond.h"
 #include "ansidecl.h"
@@ -111,6 +112,7 @@ enum syscall_names
   syscall_time,
   syscall_times,
   syscall_unlink,
+  syscall_utime,
   syscall_vfork,
   syscall_write
 };
@@ -706,6 +708,7 @@ extern char * EXFUN (getlogin, (void));
 #define UX_system system
 #define UX_time time
 #define UX_unlink unlink
+#define UX_utime utime
 #define UX_write write
 #define UX_wait wait
 
index 50c22bbcef157a53307db8d933884aa159cdb730..71fe9ab77654f2dab718b807cb7d9cd9998c2c5c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.58 1991/08/24 01:51:14 cph Exp $
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.59 1991/09/05 22:27:17 markf Exp $
 ;;;
 ;;;    Copyright (c) 1987-91 Massachusetts Institute of Technology
 ;;;
               TIME
               TIMES
               UNLINK
+              UTIME
               VFORK
               WRITE
               ))
 
 ;;; This identification string is saved by the system.
 
-"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.58 1991/08/24 01:51:14 cph Exp $"
\ No newline at end of file
+"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.59 1991/09/05 22:27:17 markf Exp $"
\ No newline at end of file