Skip to main content

The "xzip_get_readonly" Function

Syntax#

xzip_get_readonly(arch, file);
ArgumentTypeDescription
archstringThe full path and filename of the archive to check
filestring/integerThe name or index of a file to check

Description#

Checks whether the read-only flag is enabled or disabled for the given file and returns true or false. If the input archive or file within do not exist, false will also be returned, as this indicates the archive/file can be written.

This function does not support folders as file inputs.

Example#

if (!xzip_get_readonly("C:\\archive.xz", "file1.txt")) {
xzip_rename("C:\\archive.xz", "file1.txt", "textfile.txt");
}

This will check if a file is read-only before attempting to rename it.