comparison src/fileio.c @ 167:85ec50267440 r20-3b10

Import from CVS: tag r20-3b10
author cvs
date Mon, 13 Aug 2007 09:45:46 +0200
parents 59463afc5666
children 15872534500d
comparison
equal deleted inserted replaced
166:7a77eb660975 167:85ec50267440
3370 we should signal an error rather than blissfully continuing 3370 we should signal an error rather than blissfully continuing
3371 along. ARGH, this function is going to lose lose lose. We need 3371 along. ARGH, this function is going to lose lose lose. We need
3372 to protect the current_buffer from being destroyed, but the 3372 to protect the current_buffer from being destroyed, but the
3373 multiple return points make this a pain in the butt. */ 3373 multiple return points make this a pain in the butt. */
3374 3374
3375 #if 0
3375 #ifdef DOS_NT 3376 #ifdef DOS_NT
3376 int buffer_file_type 3377 int buffer_file_type
3377 = NILP (current_buffer->buffer_file_type) ? O_TEXT : O_BINARY; 3378 = NILP (current_buffer->buffer_file_type) ? O_TEXT : O_BINARY;
3378 #endif /* DOS_NT */ 3379 #endif /* DOS_NT */
3380 #endif
3379 3381
3380 #ifdef MULE 3382 #ifdef MULE
3381 codesys = Fget_coding_system (codesys); 3383 codesys = Fget_coding_system (codesys);
3382 #endif /* MULE */ 3384 #endif /* MULE */
3383 3385
3460 fn = filename; 3462 fn = filename;
3461 desc = -1; 3463 desc = -1;
3462 if (!NILP (append)) 3464 if (!NILP (append))
3463 #ifdef DOS_NT 3465 #ifdef DOS_NT
3464 desc = open ((char *) XSTRING_DATA (fn), 3466 desc = open ((char *) XSTRING_DATA (fn),
3465 (O_WRONLY | buffer_file_type), 0); 3467 (O_WRONLY | O_BINARY), 0);
3466 #else /* not DOS_NT */ 3468 #else /* not DOS_NT */
3467 desc = open ((char *) XSTRING_DATA (fn), O_WRONLY, 0); 3469 desc = open ((char *) XSTRING_DATA (fn), O_WRONLY, 0);
3468 #endif /* not DOS_NT */ 3470 #endif /* not DOS_NT */
3469 3471
3470 if (desc < 0) 3472 if (desc < 0)
3471 #ifndef VMS 3473 #ifndef VMS
3472 { 3474 {
3473 #ifdef DOS_NT 3475 #ifdef DOS_NT
3474 desc = open ((char *) XSTRING_DATA (fn), 3476 desc = open ((char *) XSTRING_DATA (fn),
3475 (O_WRONLY | O_TRUNC | O_CREAT | buffer_file_type), 3477 (O_WRONLY | O_TRUNC | O_CREAT | O_BINARY),
3476 (S_IREAD | S_IWRITE)); 3478 (S_IREAD | S_IWRITE));
3477 #else /* not DOS_NT */ 3479 #else /* not DOS_NT */
3478 desc = creat ((char *) XSTRING_DATA (fn), 3480 desc = creat ((char *) XSTRING_DATA (fn),
3479 ((auto_saving) ? auto_save_mode_bits : 0666)); 3481 ((auto_saving) ? auto_save_mode_bits : 0666));
3480 #endif /* DOS_NT */ 3482 #endif /* DOS_NT */
4412 if we actually auto-saved any files. */ 4414 if we actually auto-saved any files. */
4413 if (!auto_saved && GC_STRINGP (listfile) && listdesc < 0) 4415 if (!auto_saved && GC_STRINGP (listfile) && listdesc < 0)
4414 { 4416 {
4415 #ifdef DOS_NT 4417 #ifdef DOS_NT
4416 listdesc = open ((char *) XSTRING_DATA (listfile), 4418 listdesc = open ((char *) XSTRING_DATA (listfile),
4417 O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, 4419 O_WRONLY | O_TRUNC | O_CREAT | O_BINARY,
4418 S_IREAD | S_IWRITE); 4420 S_IREAD | S_IWRITE);
4419 #else /* not DOS_NT */ 4421 #else /* not DOS_NT */
4420 listdesc = creat ((char *) XSTRING_DATA (listfile), 0666); 4422 listdesc = creat ((char *) XSTRING_DATA (listfile), 0666);
4421 #endif /* not DOS_NT */ 4423 #endif /* not DOS_NT */
4422 4424