Author Topic: Move files?  (Read 882 times)

Can the torque game engine move files? I would like to create an add-on that includes files and moves them to a different folder. Is it possible? Or did Badspot run it over with a steamroller...

It never existed in the engine.

It never existed in the engine.
Code: [Select]
%from = "";
%to = "";
fileCopy(%from, %to);
fileDelete(%from);
derp

filecopy()? no loving way

filecopy()? no loving way
I know, I randomly founds those functions and I was surprised.
So much time and I didn't even know they existed.

I know, I randomly founds those functions and I was surprised.
So much time and I didn't even know they existed.

Thanks ;D

However, all forms of file reading may be restricted to certain folder.

Bug: It is possible, though, to write to files outside of Blockland's directory. I won't say how, but it would be a good idea for Badspot to start restricting write permission...

I can't seem to copy anything ;o

I tried

fileCopy("screenshots/Blockland_00019.png","base");

And nothing happened. ;-;

I can't seem to copy anything ;o

I tried

fileCopy("screenshots/Blockland_00019.png","base");

And nothing happened. ;-;
You cannot read/write into the same directory as Blockland.exe, so you can't create the file "base".

You cannot read/write into the same directory as Blockland.exe, so you can't create the file "base".

I was copying a screenshot to the base folder.

Try:
Code: [Select]
fileCopy("screenshots/Blockland_00019.png","base/Blockland_00019.png");

Try:
Code: [Select]
fileCopy("screenshots/Blockland_00019.png","base/Blockland_00019.png");

I love you. Thank you soo much!! :D

yep, first arg is the file to copy, second is the file to copy it to.

yep, first arg is the file to copy, second is the file to copy it to.
Remember this, because most code in languages involving file systems do it in this fashion.

Alright. I made an add-on that moves files, but when it executes before Blockland loads, the console will loop, and the game will never load. :I