FOM Reference > Application > Datatypes > fPath interface
  
fPath interface
This object represents the path to a file. No attempt is made to ensure this path is valid and could result in errors if it gets used whilst the properties contain invalid data.
PathType enumeration
The type of path this object represents if the path refers to an internal PTC ALD path.
The PathType enumeration has the following constants of type int.
TYPE_FILE = 0
This path represents a normal file. The device property contains the name of the physical drive or internet protocol the file is located in.
TYPE_AREA = 1
This path represents a file located in an PTC ALD Area. The device property contains the name of the area.
TYPE_LIB = 2
This path represents a file located in an PTC ALD Library directory. The device property contains the name of the library to use.
TYPE_APPBASE = 3
This path represents a file located in the PTC ALD install directory. The device property is empty and will be ignored.
TYPE_DOCBASE = 4
This path represents a file located in the PTC ALD documents directory. The device property is empty and will be ignored.
TYPE_STREAMBASE = 5
This path represents a file located in a PTC ALD Stream Base directory. The device property contains the name of the stream to use, or can be left empty to use the system base directory.
TYPE_PERLCHANNEL = 6
This path represents a Perl Channel. The device property contains the number of the Perl Channel and will be between 3 and 7.
TYPE_STREAM = 7
This path represents an PTC ALD Stream. The device property contains the mode number and will be between 0, 1 or 2.
TYPE_DOCUMENTATION = 9
This path represents a file located in the PTC ALD Documentation directory. The device property is empty and will be ignored.
device attribute
If the path represents an external file, this contains the name of drive or device containing the file. If the path refers to an PTC ALD path, this contains the name of the area or channel. If the path refers to an internet location, this contains the protocol.
device
Access
read-write
Returns
String
directory attribute
If the path represents an external file, this contains the names of the directories containing the file on the specified device including the trailing slash, if required. If the path refers to an internet location, this contains the host name, e.g. "//www.ptc.com/".
directory
Access
read-write
Returns
String
encoding attribute
If the path represents an external file, this contains the encoding used to access the file. This property is only valid in the Unicode version of PTC ALD, and is ignored if the file is a stream or perl channel.
encoding
Access
read-write
Returns
String
extension attribute
The file extension, if required.
extension
Access
read-write
Returns
String
filename attribute
The actual name of the file without any paths or file extensions.
filename
Access
read-write
Returns
String
path attribute
The full path to the file, including filename and any device or protocol as required. Note that this property is directly linked to all other properties on this object, for example changing it will automatically update the other properties that might be affected. Similarly, if any of the properties are modified, this value will also be updated to reflect those changes. Whilst it is possible to set this property using the old "{" syntax, it will automatically be converted to the x3b2 scheme as described in the XML documentation.
path
Access
read-write
Returns
String
type attribute
This is the type of path, e.g. if it represents an area, stream, or Perl channel. This value is one of fPath.PathType.
type
Access
read-write
Returns
int
fPath method
Creates a new fPath object.
fPathpath
Parameters
Stringpath
Initialises the properties of this object to the values contained in this path.
Returns
fPath. The newly created fPath object.
readResolve method
Return the object corresponding to the given serialized representation.
readResolveobj
Parameters
Objectobj
The serialized representation.
Returns
fPath. The object corresponding to the serialized representation.
resolve method
Outputs the full path as a string resolving any areas if possible, otherwise it will return the same as toString().
resolve
Parameters
None
Returns
String. A string representation of the contents of this fPath object.
toString method
Outputs the full path as a string. This method returns the same value as the path property.
toString
Parameters
None
Returns
String. A string representation of the contents of this fPath object.