copy
Type: Function
Copy a file.
The source file can use any accessor - for example one can copy
the $MFT using the ntfs accessor to a regular file. Another
example is to extract a file from a zip file using the zip
accessor into a file on disk.
This function can also be used to create new files with prescribed content, for example:
SELECT copy(filename="Hello world", accessor="data", dest="C:/hi.txt")
FROM scope()
NOTE: Sparse files are padded out
| Argument | Type | Description |
|---|---|---|
filename |
accessors.OSPath (required) | The file to copy from. |
accessor |
string | The accessor to use |
dest |
string (required) | The destination file to write. |
permissions |
string | Permissions for the destination file (e.g. rw-rw-rwx or 0755). |
dir_permissions |
string | Permissions for intermediate directories. |
append |
bool | If true we append to the target file otherwise truncate it |
create_directories |
bool | If true we ensure the destination directories exist |
Required permissions: FILESYSTEM_WRITE, FILESYSTEM_READ
Platforms: macOS, Linux, Windows
Source: vql/filesystem/copy.go