The Path object represents a file or folder path. Many objects have properties that return a Path - for example, Tab.path returns the current folder in a tab as a Path object. You can create a new Path object from a string (or another Path) using the DOpus.FSUtil.NewPath method.
Property Name |
Return Type |
Description |
---|---|---|
<default value> |
string |
Returns the full path as a string. |
components |
int |
Returns the number of components in the path. |
disks |
Vector:int |
Returns a Vector of ints representing the physical disk drive or drives that this path resides on. |
drive |
int |
Returns the drive number the path refers to (1=A, 2=B, etc.) or 0 if the path does not specify a drive. |
ext |
string |
Returns the filename extension of the path (the sub-string
extending from the last . in the final
component to the end of the string). This method does not check if the
path actually refers to a file. |
filepart |
string |
Returns the filename part of the path (the last component). |
pathpart |
string |
Returns the path minus the last component. |
test_parent |
bool |
Returns True if a call to the Parent method would succeed. |
test_root |
bool |
Returns True if a call to the Root method would succeed. |
Method Name |
Arguments |
Return Type |
Description |
---|---|---|---|
Add |
<string:name> |
none |
Adds the specified name to the path (it will become the last component). |
Parent |
none |
bool |
Removes the last component of the path. Returns False if the path does not have a valid parent. |
Root |
none |
bool |
Strips off all but the first component of the path. Returns False if the path is already at the root. |
Set |
<string:path> |
none |
Sets the path represented by the Path object to the specified string. You can also set one Path object to the value of another. |