The "xzip_set_readonly" Function
#
SyntaxArgument | Type | Description |
---|---|---|
arch | string | The full path and filename of the archive to modify |
enable | boolean | Sets whether to enable or disable the read-only flag |
file1 | string/integer/array/keyword | The name or index of a file to modify, or array of files (or keyword 'all' for all files) |
[file2] | string | Optional: Additional files to modify (arrays and keywords not accepted) |
#
DescriptionEnables or disables flagging files as read-only within the given archive created with xzip_create
. Files flagged as read-only cannot be overwritten, deleted, renamed, or moved without first disabling the read-only flag.
If a folder is input, all files inside will be modified.
Also returns true
or false
to indicate if the operation succeeded or failed.
note
If multiple files are input, even a single error will return false
even though other files succeeded. In this scenario, use xzip_report
to retrieve a list of failed files.
#
ExampleThis will make all files read-only except "file1.txt" and "file3.png".