TorqueScript Reference
Functions

Functions

bool createPath (fileName or pathName)
 
bool directoryDelete (directoryName)
 
string fileBase (fileName)
 
bool fileDelete (fileName)
 
string fileExt (fileName)
 
string fileName (filePathName)
 
string filePath (fileName)
 
int fileSize (fileName)
 
string findFirstFile (strPattern)
 
string findFirstFileMultiExpr (strPattern)
 
string findNextFile (strPattern)
 
string findNextFileMultiExpr (string pattern)
 
string getCurrentDate (bool reverse)
 
string getCurrentDirectory ()
 
string getDirectoryList (strPath,[intDepth]?)
 
string getExecutableName ()
 
int getFileCount (strPattern)
 
int getFileCountMultiExpr (strPattern)
 
int getFileCRC (filename)
 
string getFileList (strPath)
 
string getMainDotCsDir ()
 
bool isDirectory (path)
 
bool isFile (fileName)
 
bool isValidImageFile (string filePath)
 
bool isWriteableFileName (fileName)
 
string makeFullPath (string path,[string currentWorkingDir]?)
 
string makeRelativePath (string path, string to)
 
void openFolder (path)
 
string pathConcat (string path, string file1,[...fileN]*)
 
bool pathCopy (fromFile, toFile,[nooverwrite=true]?)
 
void restartInstance ()
 
bool setCurrentDirectory (absolutePathName)
 

Detailed Description

Function Documentation

bool createPath ( fileName or  pathName)

creates the path or path to the file name

bool directoryDelete ( directoryName  )
Parameters
directoryNameName of the directory to remove
Returns
Returns true on success and false on failure
string fileBase ( fileName  )
bool fileDelete ( fileName  )
Parameters
fileNameName of the file to remove
Returns
Returns true on success and false on failure
string fileExt ( fileName  )
Parameters
Nameof file from which to extract extension
Returns
A string containing the file's extension (assuming all data after first '.' is the extension) or returns empty string on failure
string fileName ( filePathName  )

Extract the filename from the full path description

string filePath ( fileName  )

Extract the file path from a file's full desciption

int fileSize ( fileName  )
Parameters
fileNameThe name of the file to check.
Returns
Returns the size of the file as an integer or -1 if file not found
string findFirstFile ( strPattern  )
Parameters
strPatternThe string pattern to search for.
Returns
Returns a string representing the first file in the directory system matching the given pattern.
string findFirstFileMultiExpr ( strPattern  )
Parameters
strPatternThe string pattern to search for.
Returns
Returns the first file in the directory system matching the given pattern.
string findNextFile ( strPattern  )
Parameters
strPatternThe string pattern to search for.
Returns
Returns the next file matching a search begun in findFirstFile.
string findNextFileMultiExpr ( string  pattern)

Returns the next file matching a search begun in findFirstFile.

string getCurrentDate ( bool  reverse)

Gets the current date and time.

Parameters
reverseDetermines if the format will be Month/Day/Year/Hour:Min:Seconds or Year/Month/Day/Hour:Min:Seconds
string getCurrentDirectory ( )
string getDirectoryList ( strPath  ,
[intDepth] ?   
)
Parameters
strPathThe path in which to check
intDepthThe depth in which to return (default 0 if not specified)
Returns
The directory contents
string getExecutableName ( )
int getFileCount ( strPattern  )
Parameters
strPatternThe string pattern to search for.
Returns
Returns the number of files in the directory tree that match the given pattern
int getFileCountMultiExpr ( strPattern  )
Parameters
strPatternThe string pattern to search for.
Returns
Returns the number of files in the directory tree that match the given pattern
int getFileCRC ( filename  )
Parameters
filenameThe string representing the file from which to get the CRC
Returns
An integer
string getFileList ( strPath  )

Gets all the files in the specified directory.

Parameters
strPathThe path in which to check
Returns
A list of files in the specified directory.
string getMainDotCsDir ( )
bool isDirectory ( path  )
Parameters
pathNamePath to check.
Returns
Returns true if the given path is a folder/directory, false otherwise
bool isFile ( fileName  )
Parameters
fileNameFilename to check.
Returns
Returns true if the given filename is an existing file or false otherwise
bool isValidImageFile ( string  filePath)
Parameters
filePathFull path of file to check.
Returns
Returns true if the given filename is a valid image file or false otherwise
bool isWriteableFileName ( fileName  )
Parameters
fileNameFilename to check.
Returns
Returns true if the given filename is an existing file and is not Read-Only or false otherwise
string makeFullPath ( string  path,
[string currentWorkingDir] ?   
)
string makeRelativePath ( string  path,
string  to 
)
void openFolder ( path  )

;

string pathConcat ( string  path,
string  file1,
[... fileN] *   
)
bool pathCopy ( fromFile  ,
toFile  ,
[nooverwrite = true] ?   
)
void restartInstance ( )
bool setCurrentDirectory ( absolutePathName  )