comparison src/fileio.c @ 2147:2bd29808d1f6 v7.2.429

updated for version 7.2.429 Problem: A file that exists but access is denied may result in a "new file" message. E.g. when its directory is unreadable. Solution: Specifically check for ENOENT to decide a file doesn't exist. (partly by James Vega)
author Bram Moolenaar <bram@zimbu.org>
date Fri, 14 May 2010 18:56:38 +0200
parents 8aa3cd045aef
children f60a0c9cbe6c
comparison
equal deleted inserted replaced
2146:c17a42da3920 2147:2bd29808d1f6
593 } 593 }
594 else 594 else
595 #endif 595 #endif
596 if (newfile) 596 if (newfile)
597 { 597 {
598 if (perm < 0) 598 if (perm < 0
599 #ifdef ENOENT
600 && errno == ENOENT
601 #endif
602 )
599 { 603 {
600 /* 604 /*
601 * Set the 'new-file' flag, so that when the file has 605 * Set the 'new-file' flag, so that when the file has
602 * been created by someone else, a ":w" will complain. 606 * been created by someone else, a ":w" will complain.
603 */ 607 */
661 else 665 else
662 { 666 {
663 filemess(curbuf, sfname, (char_u *)( 667 filemess(curbuf, sfname, (char_u *)(
664 # ifdef EFBIG 668 # ifdef EFBIG
665 (errno == EFBIG) ? _("[File too big]") : 669 (errno == EFBIG) ? _("[File too big]") :
670 # endif
671 # ifdef EOVERFLOW
672 (errno == EOVERFLOW) ? _("[File too big]") :
666 # endif 673 # endif
667 _("[Permission Denied]")), 0); 674 _("[Permission Denied]")), 0);
668 curbuf->b_p_ro = TRUE; /* must use "w!" now */ 675 curbuf->b_p_ro = TRUE; /* must use "w!" now */
669 } 676 }
670 } 677 }