Help about Torque Script
by M Mahmud Hasan · in Torque Game Engine · 12/02/2006 (12:02 pm) · 2 replies
Hi,
I need some help about file manipulation using Torque Script. I don't know if it is possible or not.
I need to write a function that will copy one file from one folder to another.
Can anyone help me, how to do this? I checked out the TDN for script File I/O section, but I didn't get any help.
Thank you in advnce!!
I need some help about file manipulation using Torque Script. I don't know if it is possible or not.
I need to write a function that will copy one file from one folder to another.
Can anyone help me, how to do this? I checked out the TDN for script File I/O section, but I didn't get any help.
Thank you in advnce!!
Employee Michael Perry
ZombieShortbus
function copyFile(%sourceFilePath, %destinationFilePath) { %souceFile = new FileObject(); %destFile = newFileObject(); %sourceFile.openForRead(%sourceFilePath); %destFile.openForWrite(%destinationFilePath); while(!%sourceFile.isEOF()) { %line = %sourceFile.readLine(); %destFile.writeLine(%line); } %sourceFile.delete(); %destFile.delete(); }I haven't tried it yet, but that's my understanding of Torque Script file I/O. Here's the TDN link: FileObject