diff options
| author | Gerd Moellmann | 2001-04-10 12:15:53 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-04-10 12:15:53 +0000 |
| commit | e8691c592f990d7962f64fb9588a2f2d93b5a0fb (patch) | |
| tree | ced4d9ec6e19f2291f048450eb324939b2294652 /src | |
| parent | 302f0b29125675990ffd5825f6e6b9f9912cde84 (diff) | |
| download | emacs-e8691c592f990d7962f64fb9588a2f2d93b5a0fb.tar.gz emacs-e8691c592f990d7962f64fb9588a2f2d93b5a0fb.zip | |
(Fcopy_file) [WINDOWSNT]: Use CopyFile.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index 26853a83c25..84a0c6c625c 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2334,6 +2334,22 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 2334 | else if (stat (XSTRING (encoded_newname)->data, &out_st) < 0) | 2334 | else if (stat (XSTRING (encoded_newname)->data, &out_st) < 0) |
| 2335 | out_st.st_mode = 0; | 2335 | out_st.st_mode = 0; |
| 2336 | 2336 | ||
| 2337 | #ifdef WINDOWSNT | ||
| 2338 | if (!CopyFile (XSTRING (encoded_file)->data, | ||
| 2339 | XSTRING (encoded_newname)->data, | ||
| 2340 | FALSE)) | ||
| 2341 | report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil))); | ||
| 2342 | else if (NILP (keep_time)) | ||
| 2343 | { | ||
| 2344 | EMACS_TIME now; | ||
| 2345 | EMACS_GET_TIME (now); | ||
| 2346 | if (set_file_times (XSTRING (encoded_newname)->data, | ||
| 2347 | now, now)) | ||
| 2348 | Fsignal (Qfile_date_error, | ||
| 2349 | Fcons (build_string ("Cannot set file date"), | ||
| 2350 | Fcons (newname, Qnil))); | ||
| 2351 | } | ||
| 2352 | #else /* not WINDOWSNT */ | ||
| 2337 | ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0); | 2353 | ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0); |
| 2338 | if (ifd < 0) | 2354 | if (ifd < 0) |
| 2339 | report_file_error ("Opening input file", Fcons (file, Qnil)); | 2355 | report_file_error ("Opening input file", Fcons (file, Qnil)); |
| @@ -2423,6 +2439,7 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 2423 | } | 2439 | } |
| 2424 | 2440 | ||
| 2425 | emacs_close (ifd); | 2441 | emacs_close (ifd); |
| 2442 | #endif /* WINDOWSNT */ | ||
| 2426 | 2443 | ||
| 2427 | /* Discard the unwind protects. */ | 2444 | /* Discard the unwind protects. */ |
| 2428 | specpdl_ptr = specpdl + count; | 2445 | specpdl_ptr = specpdl + count; |