The "xzip_move" Function

Syntax

xzip_move(arch, dir, file1, [file2], ...);
ArgumentTypeDescription
archstringThe full path and filename of the archive to create
dirstringThe internal path of the destination folder to move into
file1string/integer/array/keywordThe name or index of a file to move, or array of files (or keyword 'all' for all files)
[file2]stringOptional: Additional files to move (arrays and keywords not accepted)

Description

Moves one or more files to a subfolder within an archive previously created with xzip_create. Upon extraction, files will appear in the new subfolder. If any subfolder in the destination path does not exist, it will be created.

If a folder is input, all files inside will be moved to the new location--the relative path will not be preserved.

Also returns true or false to indicate if the operation succeeded or failed. Note that this includes failure to move a file flagged as read-only. (This can be determined with xzip_get_readonly.)

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.

As archives have no mount point, you should not supply a drive letter or leading slash when specifying a destination folder. Use "" to move files to the root directory of the archive.

important

Due to GameMaker's string handling, slashes in paths should be escaped (i.e. \\, not \). Do not add a final slash to directories!

Note that this script does not move the archive itself! For that, use the built-in file_copy and file_delete functions.

Example

xzip_move("C:\\archive.xz", "my\\destination\\folder", "file1.txt", "file5.pdf");