TrFile_FindFolder |
Returns the path to special folders (subdirectories).
Syntax
TrFile_FindFolder ( folderSwitch )
Parameters
folderSwitch | specifies the name of the wanted special folder. |
Returned Result
Data type returned
Text
Result
FileSpec The path to the folder.
If a special folder is not available for that platform $$-1 is returned.
Originated in
Troi File Plug-in 1.1
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
Not every special folder is available for each platform.
Note that there is a trash folder for every volume. Currently this function returns the trash folder on the startup disk.
Some folders are no longer available on macOS, and will return $$-43 (file not found).
Example
Set Field [ result ; TrFile_FindFolder ( "-Trash" ) ]
This will return the full path of the Trash folder.
TIP: With this folder and the MoveFile function you can move items into the Trash. Be aware that each disk has its own trash, so there may be more than one trash. FindFolder returns the trash of the startup disk.
Example 2
Set Field [ gStartupDiskFolder ; TrFile_FindFolder ( "-Root" ) ]
This will return the top folder on the startup disk, for example “C:”.
Used in example file
FindFolder.fmp12
Related functions
TrFile_ListDisks |
TrFile_MoveFile |
Related topics
Troi File Plug-in online help (overview)