vl-file-copy

(vl-file-copy source_filename destination_filename [append_flag])

The vl-file-copy function copies or appends the contents of a source file to a destination file.

If the destination file exists, the function does not override the destination file. It will only append to it (or nothing is copied, depending on the append_flag).

If the destination file does not exit, the function simply copies a file to another with a different name.

Arguments

source_filename specifies the name of the source file as string.

destination_filename specifies the name of the destination file as string.

append_flag determines:

Return Value

The return value is an integer number if the copy was successful. The function returns nil if copying failed.

Failure causes might be:

Examples

Copying old.lsp to new.lsp:

: (vl-file-copy "old.lsp" "new.lsp")

566

Trying to copy the non-existing old.lsp file to new2.lsp:

: (vl-file-copy "old.lsp" "new2.lsp")

nil