Mercurial > hg > xemacs-beta
comparison src/fileio.c @ 100:4be1180a9e89 r20-1b2
Import from CVS: tag r20-1b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:15:11 +0200 |
parents | 364816949b59 |
children | fe104dbd9147 |
comparison
equal
deleted
inserted
replaced
99:2d83cbd90d8d | 100:4be1180a9e89 |
---|---|
2143 || INTP (ok_if_already_exists)) | 2143 || INTP (ok_if_already_exists)) |
2144 barf_or_query_if_file_exists (newname, "rename to it", | 2144 barf_or_query_if_file_exists (newname, "rename to it", |
2145 INTP (ok_if_already_exists), 0); | 2145 INTP (ok_if_already_exists), 0); |
2146 | 2146 |
2147 #ifdef WINDOWSNT | 2147 #ifdef WINDOWSNT |
2148 if (!MoveFile (XSTRING (filename)->data, XSTRING (newname)->data)) | 2148 if (!MoveFile (XSTRING (filename)->_data, XSTRING (newname)->_data)) |
2149 #else /* not WINDOWSNT */ | 2149 #else /* not WINDOWSNT */ |
2150 /* FSFmacs only calls rename() here under BSD 4.1, and calls | 2150 /* FSFmacs only calls rename() here under BSD 4.1, and calls |
2151 link() and unlink() otherwise, but that's bogus. Sometimes | 2151 link() and unlink() otherwise, but that's bogus. Sometimes |
2152 rename() succeeds where link()/unlink() fail, and we have | 2152 rename() succeeds where link()/unlink() fail, and we have |
2153 configure check for rename() and emulate using link()/unlink() | 2153 configure check for rename() and emulate using link()/unlink() |
2724 return call2 (handler, Qfile_modes, abspath); | 2724 return call2 (handler, Qfile_modes, abspath); |
2725 | 2725 |
2726 if (stat ((char *) XSTRING_DATA (abspath), &st) < 0) | 2726 if (stat ((char *) XSTRING_DATA (abspath), &st) < 0) |
2727 return Qnil; | 2727 return Qnil; |
2728 #ifdef DOS_NT | 2728 #ifdef DOS_NT |
2729 if (check_executable (XSTRING (abspath)->data)) | 2729 if (check_executable (XSTRING (abspath)->_data)) |
2730 st.st_mode |= S_IEXEC; | 2730 st.st_mode |= S_IEXEC; |
2731 #endif /* DOS_NT */ | 2731 #endif /* DOS_NT */ |
2732 | 2732 |
2733 return make_int (st.st_mode & 07777); | 2733 return make_int (st.st_mode & 07777); |
2734 } | 2734 } |
2799 DEFUN ("unix-sync", Funix_sync, 0, 0, "", /* | 2799 DEFUN ("unix-sync", Funix_sync, 0, 0, "", /* |
2800 Tell Unix to finish all pending disk updates. | 2800 Tell Unix to finish all pending disk updates. |
2801 */ | 2801 */ |
2802 ()) | 2802 ()) |
2803 { | 2803 { |
2804 #ifndef WINDOWSNT | |
2804 sync (); | 2805 sync (); |
2806 #endif | |
2805 return Qnil; | 2807 return Qnil; |
2806 } | 2808 } |
2807 #endif /* !VMS */ | 2809 #endif /* !VMS */ |
2808 | 2810 |
2809 | 2811 |
3192 } | 3194 } |
3193 #endif | 3195 #endif |
3194 NUNGCPRO; | 3196 NUNGCPRO; |
3195 } | 3197 } |
3196 | 3198 |
3199 #if 0 | |
3200 /* XXXX Why the #### ? Bogus anyway. If they are there, display em! */ | |
3197 #ifdef DOS_NT | 3201 #ifdef DOS_NT |
3198 /* Determine file type from name and remove LFs from CR-LFs if the file | 3202 /* Determine file type from name and remove LFs from CR-LFs if the file |
3199 is deemed to be a text file. */ | 3203 is deemed to be a text file. */ |
3200 { | 3204 { |
3201 struct gcpro gcpro1; | 3205 struct gcpro gcpro1; |
3206 if (NILP (buf->buffer_file_type)) | 3210 if (NILP (buf->buffer_file_type)) |
3207 { | 3211 { |
3208 buffer_do_msdos_crlf_to_lf (buf, ####); | 3212 buffer_do_msdos_crlf_to_lf (buf, ####); |
3209 } | 3213 } |
3210 } | 3214 } |
3215 #endif | |
3211 #endif | 3216 #endif |
3212 | 3217 |
3213 /* Close the file/stream */ | 3218 /* Close the file/stream */ |
3214 unbind_to (speccount, Qnil); | 3219 unbind_to (speccount, Qnil); |
3215 | 3220 |