Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
459:9d4fd877b885 | 460:223736d75acb |
---|---|
1674 statptr->st_mode = 0; | 1674 statptr->st_mode = 0; |
1675 } | 1675 } |
1676 return; | 1676 return; |
1677 } | 1677 } |
1678 | 1678 |
1679 /* A slightly higher-level interface than `set_file_times' */ | |
1680 static int | |
1681 lisp_string_set_file_times (Lisp_Object filename, | |
1682 EMACS_TIME atime, EMACS_TIME mtime) | |
1683 { | |
1684 char *ext_filename; | |
1685 LISP_STRING_TO_EXTERNAL (filename, ext_filename, Qfile_name); | |
1686 return set_file_times (ext_filename, atime, mtime); | |
1687 } | |
1688 | |
1679 DEFUN ("copy-file", Fcopy_file, 2, 4, | 1689 DEFUN ("copy-file", Fcopy_file, 2, 4, |
1680 "fCopy file: \nFCopy %s to file: \np\nP", /* | 1690 "fCopy file: \nFCopy %s to file: \np\nP", /* |
1681 Copy FILENAME to NEWNAME. Both args must be strings. | 1691 Copy FILENAME to NEWNAME. Both args must be strings. |
1682 Signals a `file-already-exists' error if file NEWNAME already exists, | 1692 Signals a `file-already-exists' error if file NEWNAME already exists, |
1683 unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil. | 1693 unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil. |
1811 if (!NILP (keep_time)) | 1821 if (!NILP (keep_time)) |
1812 { | 1822 { |
1813 EMACS_TIME atime, mtime; | 1823 EMACS_TIME atime, mtime; |
1814 EMACS_SET_SECS_USECS (atime, st.st_atime, 0); | 1824 EMACS_SET_SECS_USECS (atime, st.st_atime, 0); |
1815 EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); | 1825 EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); |
1816 if (set_file_times ((char *) XSTRING_DATA (newname), atime, | 1826 if (lisp_string_set_file_times (newname, atime, mtime)) |
1817 mtime)) | |
1818 report_file_error ("I/O error", list1 (newname)); | 1827 report_file_error ("I/O error", list1 (newname)); |
1819 } | 1828 } |
1820 chmod ((const char *) XSTRING_DATA (newname), | 1829 chmod ((const char *) XSTRING_DATA (newname), |
1821 st.st_mode & 07777); | 1830 st.st_mode & 07777); |
1822 } | 1831 } |