file_copy(fname, newname);
Argument | Description |
---|---|
fname | The name of the file to copy. |
newname | The name of the new, copied, file. |
Returns: N/A
This function will copy the specified file, giving it the new
name that you choose. If you are copying a file on Android
from within your Included Files area (which will be inside
your APK) it will copy into memory first, so, be aware that copying
very large files from the APK may cause devices to run out of
memory. On JavaScript platforms (HTML5), we use the HTML5 Local
Storage API for client side saving, and the functions does not
support binary file operations, so assumes you are copying a text
file.
WARNING! This function may not work as you expect due to
GameMaker: Studio being sandboxed! Please see the section on
File System Limits for
more information.
if file_exists("level1.txt")
{
file_copy("level1.txt", "level2.txt");
}
This would check for a file and if it exists it is copied.