2409 |
else if (NILP (keep_time)) |
else if (NILP (keep_time)) |
2410 |
{ |
{ |
2411 |
EMACS_TIME now; |
EMACS_TIME now; |
2412 |
|
DWORD attributes; |
2413 |
|
char * filename; |
2414 |
|
|
2415 |
EMACS_GET_TIME (now); |
EMACS_GET_TIME (now); |
2416 |
if (set_file_times (XSTRING (encoded_newname)->data, |
filename = XSTRING (encoded_newname)->data; |
2417 |
now, now)) |
|
2418 |
Fsignal (Qfile_date_error, |
/* Ensure file is writable while its modified time is set. */ |
2419 |
Fcons (build_string ("Cannot set file date"), |
attributes = GetFileAttributes (filename); |
2420 |
Fcons (newname, Qnil))); |
SetFileAttributes (filename, attributes ^ FILE_ATTRIBUTE_READONLY); |
2421 |
|
if (set_file_times (filename, now, now)) |
2422 |
|
{ |
2423 |
|
/* Restore original attributes. */ |
2424 |
|
SetFileAttributes (filename, attributes); |
2425 |
|
Fsignal (Qfile_date_error, |
2426 |
|
Fcons (build_string ("Cannot set file date"), |
2427 |
|
Fcons (newname, Qnil))); |
2428 |
|
} |
2429 |
|
/* Restore original attributes. */ |
2430 |
|
SetFileAttributes (filename, attributes); |
2431 |
} |
} |
2432 |
#else /* not WINDOWSNT */ |
#else /* not WINDOWSNT */ |
2433 |
ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0); |
ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0); |