version 1.92, 2014/03/20 07:47:29 |
version 1.93, 2014/03/31 21:29:59 |
|
|
*/ |
*/ |
if (fisdir(fname) == TRUE) { |
if (fisdir(fname) == TRUE) { |
ro = TRUE; |
ro = TRUE; |
} else if (access(fname, W_OK) == -1) { |
} else if ((access(fname, W_OK) == -1) && (errno != ENOENT)) { |
if (errno != ENOENT) |
ro = TRUE; |
|
} else if (errno == ENOENT) { |
|
(void)xdirname(dp, fname, sizeof(dp)); |
|
(void)strlcat(dp, "/", sizeof(dp)); |
|
|
|
if (stat(dp, &statbuf) == -1 && errno == ENOENT) { |
|
/* not read-only; like emacs */ |
|
ewprintf("Use M-x make-directory RET RET to create the" |
|
" directory and its parents"); |
|
} else if (access(dp, W_OK) == -1 && errno == EACCES) { |
|
ewprintf("File not found and directory" |
|
" write-protected"); |
ro = TRUE; |
ro = TRUE; |
else if (errno == ENOENT) { |
|
(void)xdirname(dp, fname, sizeof(dp)); |
|
(void)strlcat(dp, "/", sizeof(dp)); |
|
if (stat(dp, &statbuf) == -1 && errno == ENOENT) { |
|
/* no read-only; like emacs */ |
|
ewprintf("Use M-x make-directory RET RET to " |
|
"create the directory and its parents"); |
|
} else if (access(dp, W_OK) == -1 && |
|
errno == EACCES) { |
|
ewprintf("File not found and directory" |
|
" write-protected"); |
|
ro = TRUE; |
|
} |
|
} |
} |
} |
} |
if (ro == TRUE) |
if (ro == TRUE) |