aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorJim Blandy1992-02-05 23:35:33 +0000
committerJim Blandy1992-02-05 23:35:33 +0000
commitb72dea2a9e2215a98767af5e86ec5e19f2391efb (patch)
tree4bcffa2cc8c1c1ec9d2e427c5b715cc558791c37 /src/fileio.c
parentff17867bb63f7b339cf593bb1b554a86f5c976c0 (diff)
downloademacs-b72dea2a9e2215a98767af5e86ec5e19f2391efb.tar.gz
emacs-b72dea2a9e2215a98767af5e86ec5e19f2391efb.zip
*** empty log message ***
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/fileio.c b/src/fileio.c
index d1bac1596a5..42ac45b4e53 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -464,8 +464,12 @@ DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
464Second arg DEFAULT is directory to start with if FILENAME is relative\n\ 464Second arg DEFAULT is directory to start with if FILENAME is relative\n\
465 (does not start with slash); if DEFAULT is nil or missing,\n\ 465 (does not start with slash); if DEFAULT is nil or missing,\n\
466the current buffer's value of default-directory is used.\n\ 466the current buffer's value of default-directory is used.\n\
467Filenames containing `.' or `..' as components are simplified;\n\ 467Path components that are `.' are removed, and \n\
468initial `~/' expands to your home directory.\n\ 468path components followed by `..' are removed, along with the `..' itself;\n\
469note that these simplifications are done without checking the resulting\n\
470paths in the file system.\n\
471An initial `~/' expands to your home directory.\n\
472An initial `~USER/' expands to USER's home directory.\n\
469See also the function `substitute-in-file-name'.") 473See also the function `substitute-in-file-name'.")
470 (name, defalt) 474 (name, defalt)
471 Lisp_Object name, defalt; 475 Lisp_Object name, defalt;
@@ -1830,6 +1834,23 @@ if the directory so specified exists and really is a directory.")
1830 return (st.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; 1834 return (st.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil;
1831} 1835}
1832 1836
1837DEFUN ("file-accessible-directory-p", Ffile_accessible_directory_p, Sfile_accessible_directory_p, 1, 1, 0,
1838 "Return t if file FILENAME is the name of a directory as a file,\n\
1839and files in that directory can be opened by you. In order to use a\n\
1840directory as a buffer's current directory, this predicate must return true.\n\
1841A directory name spec may be given instead; then the value is t\n\
1842if the directory so specified exists and really is a readable and\n\
1843searchable directory.")
1844 (filename)
1845 Lisp_Object filename;
1846{
1847 if (NILP (Ffile_directory_p (filename))
1848 || NILP (Ffile_executable_p (filename)))
1849 return Qnil;
1850 else
1851 return Qt;
1852}
1853
1833DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0, 1854DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0,
1834 "Return mode bits of FILE, as an integer.") 1855 "Return mode bits of FILE, as an integer.")
1835 (filename) 1856 (filename)
@@ -2107,8 +2128,8 @@ to the file, instead of any buffer contents, and END is ignored.")
2107 desc = open (fn, O_RDWR); 2128 desc = open (fn, O_RDWR);
2108 if (desc < 0) 2129 if (desc < 0)
2109 desc = creat_copy_attrs (XTYPE (current_buffer->filename) == Lisp_String 2130 desc = creat_copy_attrs (XTYPE (current_buffer->filename) == Lisp_String
2110 ? XSTRING (current_buffer->filename)->data : 0, 2131 ? XSTRING (current_buffer->filename)->data : 0,
2111 fn); 2132 fn);
2112 } 2133 }
2113 else /* Write to temporary name and rename if no errors */ 2134 else /* Write to temporary name and rename if no errors */
2114 { 2135 {
@@ -2224,8 +2245,6 @@ to the file, instead of any buffer contents, and END is ignored.")
2224#ifndef USG 2245#ifndef USG
2225#ifndef VMS 2246#ifndef VMS
2226#ifndef BSD4_1 2247#ifndef BSD4_1
2227#ifndef alliant /* trinkle@cs.purdue.edu says fsync can return EBUSY
2228 on alliant, for no visible reason. */
2229 /* Note fsync appears to change the modtime on BSD4.2 (both vax and sun). 2248 /* Note fsync appears to change the modtime on BSD4.2 (both vax and sun).
2230 Disk full in NFS may be reported here. */ 2249 Disk full in NFS may be reported here. */
2231 if (fsync (desc) < 0) 2250 if (fsync (desc) < 0)
@@ -2233,7 +2252,6 @@ to the file, instead of any buffer contents, and END is ignored.")
2233#endif 2252#endif
2234#endif 2253#endif
2235#endif 2254#endif
2236#endif
2237 2255
2238 /* Spurious "file has changed on disk" warnings have been 2256 /* Spurious "file has changed on disk" warnings have been
2239 observed on Suns as well. 2257 observed on Suns as well.
@@ -2821,6 +2839,7 @@ nil means use format `var'. This variable is meaningful only on VMS.");
2821 defsubr (&Sfile_writable_p); 2839 defsubr (&Sfile_writable_p);
2822 defsubr (&Sfile_symlink_p); 2840 defsubr (&Sfile_symlink_p);
2823 defsubr (&Sfile_directory_p); 2841 defsubr (&Sfile_directory_p);
2842 defsubr (&Sfile_accessible_directory_p);
2824 defsubr (&Sfile_modes); 2843 defsubr (&Sfile_modes);
2825 defsubr (&Sset_file_modes); 2844 defsubr (&Sset_file_modes);
2826 defsubr (&Sfile_newer_than_file_p); 2845 defsubr (&Sfile_newer_than_file_p);