Mercurial > hg > xemacs-beta
comparison src/fileio.c @ 74:54cc21c15cbb r20-0b32
Import from CVS: tag r20-0b32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:04:33 +0200 |
parents | 131b0175ea99 |
children | 6a378aca36af |
comparison
equal
deleted
inserted
replaced
73:e2d7a37b7c8d | 74:54cc21c15cbb |
---|---|
1813 This is what happens in interactive use with M-x. | 1813 This is what happens in interactive use with M-x. |
1814 Fourth arg KEEP-TIME non-nil means give the new file the same | 1814 Fourth arg KEEP-TIME non-nil means give the new file the same |
1815 last-modified time as the old one. (This works on only some systems.) | 1815 last-modified time as the old one. (This works on only some systems.) |
1816 A prefix arg makes KEEP-TIME non-nil. | 1816 A prefix arg makes KEEP-TIME non-nil. |
1817 */ | 1817 */ |
1818 (filename, newname, ok_if_already_exists, keep_date)) | 1818 (filename, newname, ok_if_already_exists, keep_time)) |
1819 { | 1819 { |
1820 /* This function can GC */ | 1820 /* This function can GC */ |
1821 int ifd, ofd, n; | 1821 int ifd, ofd, n; |
1822 char buf[16 * 1024]; | 1822 char buf[16 * 1024]; |
1823 struct stat st, out_st; | 1823 struct stat st, out_st; |
1841 handler = Ffind_file_name_handler (newname, Qcopy_file); | 1841 handler = Ffind_file_name_handler (newname, Qcopy_file); |
1842 if (!NILP (handler)) | 1842 if (!NILP (handler)) |
1843 { | 1843 { |
1844 UNGCPRO; | 1844 UNGCPRO; |
1845 return call5 (handler, Qcopy_file, filename, newname, | 1845 return call5 (handler, Qcopy_file, filename, newname, |
1846 ok_if_already_exists, keep_date); | 1846 ok_if_already_exists, keep_time); |
1847 } | 1847 } |
1848 | 1848 |
1849 /* When second argument is a directory, copy the file into it. | 1849 /* When second argument is a directory, copy the file into it. |
1850 (copy-file "foo" "bar/") == (copy-file "foo" "bar/foo") | 1850 (copy-file "foo" "bar/") == (copy-file "foo" "bar/foo") |
1851 */ | 1851 */ |
1942 if (close (ofd) < 0) | 1942 if (close (ofd) < 0) |
1943 report_file_error ("I/O error", Fcons (newname, Qnil)); | 1943 report_file_error ("I/O error", Fcons (newname, Qnil)); |
1944 | 1944 |
1945 if (input_file_statable_p) | 1945 if (input_file_statable_p) |
1946 { | 1946 { |
1947 if (!NILP (keep_date)) | 1947 if (!NILP (keep_time)) |
1948 { | 1948 { |
1949 EMACS_TIME atime, mtime; | 1949 EMACS_TIME atime, mtime; |
1950 EMACS_SET_SECS_USECS (atime, st.st_atime, 0); | 1950 EMACS_SET_SECS_USECS (atime, st.st_atime, 0); |
1951 EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); | 1951 EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); |
1952 if (set_file_times ((char *) XSTRING_DATA (newname), atime, | 1952 if (set_file_times ((char *) XSTRING_DATA (newname), atime, |
2921 /* If the file name has special constructs in it, | 2921 /* If the file name has special constructs in it, |
2922 call the corresponding file handler. */ | 2922 call the corresponding file handler. */ |
2923 handler = Ffind_file_name_handler (filename, Qinsert_file_contents); | 2923 handler = Ffind_file_name_handler (filename, Qinsert_file_contents); |
2924 if (!NILP (handler)) | 2924 if (!NILP (handler)) |
2925 { | 2925 { |
2926 val = call8 (handler, Qinsert_file_contents, filename, | 2926 val = call6 (handler, Qinsert_file_contents, filename, |
2927 visit, beg, end, replace, codesys, used_codesys); | 2927 visit, beg, end, replace); |
2928 goto handled; | 2928 goto handled; |
2929 } | 2929 } |
2930 | 2930 |
2931 #ifdef MULE | 2931 #ifdef MULE |
2932 if (!NILP (used_codesys)) | 2932 if (!NILP (used_codesys)) |