file-op can be used to perform numerous file system operations. The given argument n must be used to determine the required operation, the value is a bit based flag denoting the operation as follows:
Log-off and close down the current ftp connect (not a file system operation but functionality was required and it had to go somewhere).
When this bit is set the command functionality is changed to delete-file, the single argument delete-file is deleted. Note this can also delete a directory if the directory is empty.
When this bit is set the command functionality is changed to move-file, the specified from-file is moved to to-file.
When this bit is set the command functionality is changed to copy-file, the specified from-file is copied to to-file.
When this bit is set the command functionality is changed to making a new directory, the specified dir-name is the name of the new directory. A file or directory of the given name must not already exist.
When this bit is set the command functionality is changed to a change mode type of operation. chmod-file is the name of the file (or directory) to change and mode is the integer mode to apply. Note that the mode value is operating system specific. The file attributes may be retrieved with the
Only one operation can be performed per invocation. The following bits in the given argument n can be used to effect the behaviour of these operations:
Enables validity checks, these include a check that the proposed file does not already exist, if so confirmation of writing is requested from the user. Also MicroEmacs checks all other current buffers for one with the proposed file name, if found, again confirmation is requested. Without this flag the command will always succeed wherever possible.
Creates a backup of any file about to be deleted or over-written. Set help on
$buffer-backup(5) for backup file-name generation.
When validity checks are enabled (see bit 0x01 above) and this bit is set, if a problem is found the command aborts rather than prompting the user. Also see the error return codes in the notes section below.
http files are not supported except as the source file when copying. ftp files are fully supported with the restriction that the from and to files cannot both be url (http or ftp) files. The one exception to this is when moving a file on the same ftp site in which case ME will attempt to use an ftp rename command.
The command is used by
ftp(3) which provides an easy to use interfaces for file manipulation.
When the command fails an error code is returned in the
$result(5) variable, which will be one of the following:
Failure due to a read error.
Failure due to a write error.
Failure due to a directory creation error.
Failure due to a file or directory deletion error.
Failure due to file write checks, i.e. file already exists etc.
Failure due to directory creation checks, i.e. the directory or file already exists.
Failure due to file delete checks, i.e. file is read only.
Failure due to source and destination files are URLs.
Copyright (c) 1998-2006 JASSPA
Last Modified: 2006/08/21
Generated On: 2006/10/07