Author Topic: Getting filenames.  (Read 745 times)

Is there a way to go through a folder and get the names of a file using script.

Code: [Select]
function servercmdTDMgetPackages(%client)
{
 %open = new FileObject();
 %name = findFirstFile("Add-Ons/Client/TeamDMv4/Packages/*.tdm");
 while(%name !$= "")
 {
  %open.openForRead(%name);
  //File read stuff
  %open.close();
  %name = findNextFile("Add-Ons/Client/TeamDMv4/Packages/*.tdm");
 }
 %open.delete();
}

Because of the way Torque does the file search routine, file searches cannot happen in the Add-On loading procedure, it erases the search and makes the file executing keep looping. I scheduled this function to happen after about three seconds, partly into the loading datablocks. The only downside is that if it echos ("**Loaded: Capture the Flag" or whatever) then it appears in the wrong place.


Is there also a way to get folder names aswell?

And is there a way to get all datablocks inuse aswell?

Found this one.
« Last Edit: October 28, 2007, 04:41:48 PM by MrPickle »