comparison src/sysdep.c @ 592:4f6ba8f1fb3d

[xemacs-hg @ 2001-05-31 12:03:37 by adrian] [PATCH] Fix time preservation in (copy-file ...) on native Windows <1yp8gt63.fsf@rapier.ecf.teradyne.com>
author adrian
date Thu, 31 May 2001 12:03:39 +0000
parents 183866b06e0b
children 023b83f4e54b
comparison
equal deleted inserted replaced
591:ec73ae6e772b 592:4f6ba8f1fb3d
3376 3376
3377 /* No need to encapsulate utime and utimes explicitly because all 3377 /* No need to encapsulate utime and utimes explicitly because all
3378 access to those functions goes through the following. */ 3378 access to those functions goes through the following. */
3379 3379
3380 int 3380 int
3381 set_file_times (char *filename, EMACS_TIME atime, EMACS_TIME mtime) 3381 set_file_times (Lisp_Object path, EMACS_TIME atime, EMACS_TIME mtime)
3382 { 3382 {
3383 #if defined (HAVE_UTIME) 3383 #if defined (WIN32_NATIVE)
3384 struct utimbuf utb; 3384 struct utimbuf utb;
3385 utb.actime = EMACS_SECS (atime); 3385 utb.actime = EMACS_SECS (atime);
3386 utb.modtime = EMACS_SECS (mtime); 3386 utb.modtime = EMACS_SECS (mtime);
3387 return mswindows_utime (path, &utb);
3388 #elif defined (HAVE_UTIME)
3389 struct utimbuf utb;
3390 Extbyte *filename;
3391 utb.actime = EMACS_SECS (atime);
3392 utb.modtime = EMACS_SECS (mtime);
3393 LISP_STRING_TO_EXTERNAL (path, filename, Qfile_name);
3387 return utime (filename, &utb); 3394 return utime (filename, &utb);
3388 #elif defined (HAVE_UTIMES) 3395 #elif defined (HAVE_UTIMES)
3389 struct timeval tv[2]; 3396 struct timeval tv[2];
3397 Extbyte *filename;
3390 tv[0] = atime; 3398 tv[0] = atime;
3391 tv[1] = mtime; 3399 tv[1] = mtime;
3400 LISP_STRING_TO_EXTERNAL (path, filename, Qfile_name);
3392 return utimes (filename, tv); 3401 return utimes (filename, tv);
3393 #else 3402 #else
3394 /* No file times setting function available. */ 3403 /* No file times setting function available. */
3395 return -1; 3404 return -1;
3396 #endif 3405 #endif