Path

Path inherits Object

Construction: Path newObj = Path();
Clone: Path newObj = Path(other);

Path is the utility scripting class to represent a system file path.

Static Methods

static Path Construct(Object aObject0, [Object aObjectN])

Creates a Path object with the joined path of aObject0 - aObjectN. Objects can be either Paths or strings.

static bool Exists(string aPath)

Returns true if the given path is a file or directory that exists on the system; returns false otherwise.

static Path GetRelativePath(string aLocalPath, string aReferencePath)

Returns a Path of the relative path from aLocalPath to aReferencePath.

static Path GetWorkingDirectory()

Returns the path of the working directory.

static bool IsDirectory(string aPath)

Returns true if a string is an existing directory; returns false otherwise.

static bool MakeDirectory(string aPath)
static bool MakeDirectory(string aPath, bool aCreateAll)

Creates the given directory. If aCreateAll is true, all non-existing directories in the path will be created. aCreateAll is true by default. Returns true if the directory is created or already exists; returns false otherwise.

Methods

bool Exists()

Returns true if the calling Path is a file or directory that exists on the system; returns false otherwise.

Path GetParentDirectory()

Returns a Path to the parent directory of the calling Path.

string GetFileExtension()

Returns the calling Path’s file extension.

string GetFileName()
string GetFileName(bool aWithFileExtension)

Returns the calling Path’s file name. The file name will be returned with the file extension by default.

Path GetRelativePath(string aReferenceDir)
Path GetRelativePath(Path aReferenceDir)

Returns a Path of the relative path from the calling Path to aReferenceDir.

bool IsDirectory()

Returns true if the calling Path is an existing directory; returns false otherwise.

bool IsFile()

Returns true if the calling Path is an existing file; returns false otherwise.

void Join(Object aObject, [Object aObjectN])

Joins the given objects to the calling Path. Objects can either be Paths or strings.

bool MakeDirectory()
bool MakeDirectory(bool aCreateAll)

Creates the given directory. If aCreateAll is true, all non-existing directories in the path will be created. aCreateAll is true by default. Returns true if the directory is created or already exists; returns false otherwise.

string ToString()

Returns the path as a string with operating system safe slashes.

void Up()

Sets the calling Path to its parent directory.