Mercurial > hg > xemacs-beta
diff src/fileio.c @ 460:223736d75acb r21-2-45
Import from CVS: tag r21-2-45
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:43:24 +0200 |
parents | 1ccc32a20af4 |
children | 0784d089fdc9 |
line wrap: on
line diff
--- a/src/fileio.c Mon Aug 13 11:42:27 2007 +0200 +++ b/src/fileio.c Mon Aug 13 11:43:24 2007 +0200 @@ -1676,6 +1676,16 @@ return; } +/* A slightly higher-level interface than `set_file_times' */ +static int +lisp_string_set_file_times (Lisp_Object filename, + EMACS_TIME atime, EMACS_TIME mtime) +{ + char *ext_filename; + LISP_STRING_TO_EXTERNAL (filename, ext_filename, Qfile_name); + return set_file_times (ext_filename, atime, mtime); +} + DEFUN ("copy-file", Fcopy_file, 2, 4, "fCopy file: \nFCopy %s to file: \np\nP", /* Copy FILENAME to NEWNAME. Both args must be strings. @@ -1813,8 +1823,7 @@ EMACS_TIME atime, mtime; EMACS_SET_SECS_USECS (atime, st.st_atime, 0); EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); - if (set_file_times ((char *) XSTRING_DATA (newname), atime, - mtime)) + if (lisp_string_set_file_times (newname, atime, mtime)) report_file_error ("I/O error", list1 (newname)); } chmod ((const char *) XSTRING_DATA (newname),