![]() |
TrFile_GetFullPathFromFileID |
Returns the current full path of a file using the deviceID and fileID of a file.
Syntax
TrFile_GetFullPathFromFileID( switches ; fileID ; deviceID )
Parameters
switches | not used, reserved for future use. Leave blank or put "-Unused" |
fileID | the fileID of the file (or folder) |
deviceID | the ID of the disk (volume) on which the file is stored |
Returned Result
Data type returned
Text
Result
The returned result is the (current) path to the file or folder. If the file cannot be found an error code is returned. An error always starts with 2 dollars, followed by the error code. You should always check for errors. Returned error codes can be:
$$-43 | fnfErr | the file or folder was not found |
Other errors may be returned.
Originated in
Troi File Plug-in 17.0
Compatibility
FileMaker Pro 18 to FileMaker Pro 22 (2025)
Considerations
Note that the operating system assigns each file and folder on a disk a serial number, which is unique to that disk.
The fileID is also called inode (on POSIX systems, which macOS is based on).
Also each disk (volume) gets a unique number. Together this will uniquely identify a file or folder on a computer.
You can move or rename a file within the same volume, but the fileID (inode) will stay the same. This means that if you store the fileID and the deviceID, you can locate this file even if it is moved or renamed by a user. This function will get you the current file path.
On macOS the fileID and deviceID are numbers, for example: 16777225.
On Windows the fileID and deviceID should be formatted hexadecimal. The fileID is 16 bytes long, and can be for example:
0x000000000000000000550010c010a710
The deviceID is four bytes, and can be for example
0x1020c7f0
Example
On macOS:
Set Variable [ $ResolvedFilePath ; TrFile_GetFullPathFromFileID ( "-Unused" ; 252901432 ; 16747220 ) ]
The returned result is the (current) path to the file, for example “MacHD:Users:John:Documents:myFile.txt”.
On Windows the FileID is 128 bit (16 bytes) and should be given like this:
Set Variable [ $ResolvedFilePath ; TrFile_GetFullPathFromFileID ( "" ;
"0x000000000000000000550010c010a710" ;
"0x40f7fa24" ]
If found, the returned result is the (current) path to the file, for example “C:\Users\John\Desktop\myFile.txt”.
Used in example file
GetPathTo.fmp12
Related functions
TrFile_GetFileAttribute |
TrFile_ResolveAlias |
Related topics
Troi File Plug-in online help (overview)