copy-file(3)
[Home]
[Commands]
[Variables]
[Macro-Dev]
[Glossary]
NAME
SYNOPSIS
DESCRIPTION
copy-file copies or moves file or directory from to file name or directory to, particular attention should be paid to the last character of to, as a trailing '/' is assumed to be a destination directory as opposed to the destination name. For example:
copy-file "a/" "b"
will copy directory a to b, effectively renaming it, whereas:
copy-file "a/" "b/"
will copy directory a into directory b/. The numeric argument n is used to modify the default behavior of the command, where the bits are defined as follows:
0x01
wWhen set copy-file copies from, when clear copy-file moves from to to.
0x02
When set the command will not prompt the user on a file read failure, the copy/move for that file will simply fail.
0x04
When set the command will not prompt the user on a file create or write failure, the copy/move for that file/directory will simply fail.
0x08
When set the command will not prompt the user on a file overwrite issue, 'no' is assumed for all, i.e. no files will be overwritten.
0x10
When set the command will not prompt the user on a file overwrite issue, 'yes' is assumed for all, i.e. any file will be overwritten if required.
0x20
When set all intermediate directories are create as required, i.e. if to evaluates to a directory that does not currently exist it will be created. If this bit is clear the command will fail if the destination directory does not yet exist.
0x40
When set the file name part of from is treated as a regular expression, as this can match multiple files to must be a directory.
0x80
When set an error is not thrown if from does not match a file.
delete-file deletes the given file or directory. The numeric argument n is used to modify the default behavior of the command, where the bits are defined as follows:
0x01
0x02
When set the file is trashed first. While this is not guaranteed to put the file beyond recovery it should make it very much harder.
0x04
When set the command will not prompt the user on a delete failure, the delete will simply fail and move on to the next.
0x08
When set the command will not prompt the user before deleting a read-only file, 'no' is assumed and all read-only files will be skipped.
0x10
When set the command will not prompt the user before deleting a read-only file, 'yes' is assumed and all read-only files will be deleted.
0x20
When set the file name part of file is treated as a regular expression, this can be used to delete multiple files.
Both commands return 4 counts in
$result(5) with the form "|<ds#>|<df#>|<fs#>|<ff#>|", a
MicroEmacs list, where the counts are defined as follows:
<ds#>
The number of directories successfully copied, moved or deleted.
<df#>
The number of directories that failed to be copied, moved or deleted.
<fs#>
The number of files successfully copied, moved or deleted.
<ff#>
The number of files that failed to be copied, moved or deleted.
NOTES
SEE ALSO
(c) Copyright JASSPA 2025
Last Modified: 2025/07/28
Generated On: 2025/09/29