Author Topic: Moving/Renaming Files  (Read 984 times)

is there a way to rename or move instead of reading/writing the whole file to the new position/name and deleting the old one?

p sure fileCopy is a thing but i'm not 100% sure just checked, it does exist. you can move and rename the file as you do that. fileCopy("path/fileA", "path2/fileRenamed");, and then delete the old file using fileDelete("path/fileA");
« Last Edit: July 22, 2015, 12:24:55 AM by otto-san »

cool, thanks
i'm guessing it will also overwrite files?
ie path2 and path1 exist
filecopy(path1, path2)
filedelete(path1)
now only path2 exists as path1's file?

cool, thanks
i'm guessing it will also overwrite files?
ie path2 and path1 exist
filecopy(path1, path2)
filedelete(path1)
now only path2 exists as path1's file?
This is correct, yes
While confirming otto-sans answer, I fount the intriguing function filecopy_hack. Wonder what it does...

This is correct, yes
While confirming otto-sans answer, I fount the intriguing function filecopy_hack. Wonder what it does...
was just thinking about this for a bit
could it copy files to outside blockland's directory?
ie the move of the BL folder from program files to documents

filecopy_hack doesn't appear to be an engine function nor any default script-defined function. Probably defined in an add-on.

was just thinking about this for a bit
could it copy files to outside blockland's directory?
ie the move of the BL folder from program files to documents
No, it has the same restrictions of a fileobject (can only access subfolders config, base, saves, screenshots, editor) and you also can't copy from/to zip files.