# HG changeset patch # User Gerd Moellmann # Date 986904953 0 # Node ID 80082652ed9fe0a22c5aad3c9ba99283183d644c # Parent 83dd2eb5365fe709c623bdc01f7a174fa26800bb (Fcopy_file) [WINDOWSNT]: Use CopyFile. diff -r 83dd2eb5365f -r 80082652ed9f src/fileio.c --- a/src/fileio.c Tue Apr 10 12:15:25 2001 +0000 +++ b/src/fileio.c Tue Apr 10 12:15:53 2001 +0000 @@ -2334,6 +2334,22 @@ else if (stat (XSTRING (encoded_newname)->data, &out_st) < 0) out_st.st_mode = 0; +#ifdef WINDOWSNT + if (!CopyFile (XSTRING (encoded_file)->data, + XSTRING (encoded_newname)->data, + FALSE)) + report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil))); + else if (NILP (keep_time)) + { + EMACS_TIME now; + EMACS_GET_TIME (now); + if (set_file_times (XSTRING (encoded_newname)->data, + now, now)) + Fsignal (Qfile_date_error, + Fcons (build_string ("Cannot set file date"), + Fcons (newname, Qnil))); + } +#else /* not WINDOWSNT */ ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0); if (ifd < 0) report_file_error ("Opening input file", Fcons (file, Qnil)); @@ -2423,6 +2439,7 @@ } emacs_close (ifd); +#endif /* WINDOWSNT */ /* Discard the unwind protects. */ specpdl_ptr = specpdl + count;