version 1.40, 2005/10/13 19:46:45 |
version 1.41, 2005/10/13 20:23:01 |
|
|
* File commands. |
* File commands. |
*/ |
*/ |
|
|
#include <libgen.h> |
|
#include "def.h" |
#include "def.h" |
|
|
|
#include <libgen.h> |
|
|
/* |
/* |
* Insert a file into the current buffer. Real easy - just call the |
* Insert a file into the current buffer. Real easy - just call the |
* insertfile routine with the file name. |
* insertfile routine with the file name. |
|
|
readin(char *fname) |
readin(char *fname) |
{ |
{ |
MGWIN *wp; |
MGWIN *wp; |
int status, i; |
int status, i, ro = FALSE; |
PF *ael; |
PF *ael; |
|
|
/* might be old */ |
/* might be old */ |
|
|
} |
} |
} |
} |
|
|
/* We need to set the READONLY flag after we insert the file. */ |
/* |
|
* We need to set the READONLY flag after we insert the file, |
|
* unless the file is a directory. |
|
*/ |
if (access(fname, W_OK) && errno != ENOENT) |
if (access(fname, W_OK) && errno != ENOENT) |
|
ro = TRUE; |
|
#ifndef NO_DIRED |
|
if (fisdir(fname) == TRUE) |
|
ro = TRUE; |
|
#endif |
|
if (ro == TRUE) |
curbp->b_flag |= BFREADONLY; |
curbp->b_flag |= BFREADONLY; |
else |
else |
curbp->b_flag &=~ BFREADONLY; |
curbp->b_flag &=~ BFREADONLY; |