Script Reference : Files

File Functions
Name Return type Description
bool DeleteFile(string) bool Deletes an existing file.
bool DeleteFolder(string) bool Deletes an existing empty directory.
bool CreateFolder(string) bool Creates a new directory.
bool RenameFile(string from,string to) bool Renames an existing file or folder.
bool CopyFile(string from,string to) bool Copies an existing file to a new file.
bool IsFileExist(string) bool This function determines the existence of a file
bool IsFolder(string) bool Function checks whether a given path is a folder or a file.
string GetSpecialFolder(string) string Same as window.GetFolder
string TerminatePath(string) string Function adds slash to the folder path.
string PathCombine(string path,string file) string Concatenates two strings that represent properly formed paths into one path. Also concatenates relative elements in file parameter.  Returns the concatenated path string.


Sample:
if(IsFolder("c:/temp/pp"))
    DeleteFolder("c:/temp/pp");
else
    CreateFolder("c:/temp/pp");
 
PathCombine Sample:
local path=GetSpecialFolder("script");	// C:\Users\John\Documents\priPrinter Files\Scripts
local file=PathCombine(path,"../file.exe");	// C:\Users\John\Documents\priPrinter Files\file.exe
TerminatePath Sample:
local path=GetSpecialFolder("script");	// C:\Users\John\Documents\priPrinter Files\Scripts
local path2=TerminatePath(path);		// C:\Users\John\Documents\priPrinter Files\Scripts\