Set the backup mode
If non-zero, backup files will be made by copying the original file
to the backup file. If zero, the backup file will be created by
renaming the original file to the backup file. The default for
BACKUP_BY_COPYING is zero because it is fastest.
Integer IsHPFSFileSystem(String path);
Returns non-zero if drive of
path (possibly the default drive) is
Integer change_default_dir (String new_dir);
This function may be used to change the current working directory
of the editor to
new_dir. It returns zero upon success or
Note: Each buffer has its own working directory. This function does not
change the working directory of the buffer. Rather, it changes the
working directory of the whole editor. This has an effect on functions
rename_file when such functions are passed relative filenames.
setbuf_info, getbuf_info, rename_file
Integer copy_file (String src, String dest);
This function may be used to copy a file named
src to a new file
dest. It attempts to preserve the file access and modification
times as well as the ownership and protection.
0 upon success and
-1 upon failure.
Integer delete_file (String file);
This function may be used to delete a file specified by the
parameter. It returns non-zero if the file was sucessfully deleted
or zero otherwise.
returns number of files and list of files which match filename. On unix, this defaults to filename*. It is primarily useful for DOS and VMS to expand wildcard filenames
String expand_filename (String file);
expand_filename function expands a file to a canonical form.
For example, under Unix, if
file has the value
"/a/c/d". Similarly, if
file has the value
"/d/e" is returned.
String extract_filename (String filespec);
This function may be used to separate the file name from the path of
of a file specified by
filespec. For example, under Unix, the
returns the string
Integer file_changed_on_disk (String fn);
This function may be used to determine if the disk file specified by the
fn is more recent than the current buffer.
Integer file_status (String filename);
file_status function returns information about a file specified
by the name
filename. It returns an integer describing the file
2 file is a directory
1 file exists and is not a directory
0 file does not exist.
-1 no access.
-2 path invalid
-3 unknown error
Integer file_time_cmp (String file1, String file2);
This function compares the modification times of two files,
file2. It returns an integer that is either
positive, negative, or zero integer for
file1 > file2,
file1 < file2, or
file1 == file2, respectively. In
this context, the comparison operators are comparing file
modification times. That is, the operator
> should be read
``is more recent than''. The convention adopted by this routine is
that if a file does not exist, its modification time is taken to be
at the beginning of time. Thus, if
f exists, but
file_time_compare (f, g) will return a positive
Integer find_file (String name);
find_file function switches to the buffer associated with the
file specified by
name. If no such buffer exists, one is created
and the file specified by
name is read from the disk and associated
with the new buffer. The buffer will also become attached to the
current window. Use the
read_file function to find a file but not
associate it with the current window.
Integer insert_file (String f);
This function may be used to insert the contents of a file named
into the buffer at the current position. The current editing point
will be placed at the end of the inserted text. The function returns
-1 if the file was unable to be opened; otherwise it returns the
number of lines inserted. This number can be zero if the file is empty.
read_file, find_file, insert
String msdos_fixup_dirspec (String dir);
The motivation behind this is that DOS does not like a trailing
backslash except if it is for the root dir. This function makes
dir conform to that.
Integer read_file (string fn);
read_file function may be used to read a file specified by
into its own buffer. It returns a non-zero value upon success and
signals an error upon failure. The hook
find_file_hook is called
after the file is read in. Unlike the related function,
this function does not create a window for the newly created buffer.
find_file, file_status, write_buffer
Integer rename_file (String old_name, String new_name);
This function may be used to change the name of a disk file from
new_name. Upon success, zero is returned. Any other
value indicates failure.
Note: Both filenames must refer to the same file system.
set_file_translation (Integer n);
This function affects only the way the next file is opened. Its affect does not last beyond that. If it the value of the parameter is 1, the next file will be opened in binary mode. If the parameter is zero, the file will be opened in text mode.