Returns the size of the resource fork for the file specified by the filePath. The size indicates the actual number of bytes used by the resource fork.
TrFile_GetResForkSize ( switches ; filePath )
|switches||not used, reserved for future use. Leave blank or put "-Unused"|
|filePath||the path to the file for which you want the information|
Data type returned
The size (in bytes) of the resource fork of the file specified. On Mac a file can have a data fork and also a resource fork. In this fork resources, like for example pictures are stored.
Troi File Plug-in 1.0
FileMaker Pro 16 to 19
This function is not available in Windows.
Assume there is a file “Read me.txt” with the text “Hello!” in it. Then:
Set Field [ MyTextField ; TrFile_GetResForkSize ( "-Unused" ; "Disk:Read me.txt" ) ]
might return 453 which is the size of the resource fork.
We assume that in your FileMaker file the following fields are defined:
gFileSpec Global, text gSize Global, number
gFileSpec should contain the path to an existing file, for example “Mac HD:Readme.txt”. In a script add the following scriptstep:
Set Field [ gSize ; TrFile_GetResForkSize ( "-Unused" ; gFileSpec ) ]
This will fill gSize with the resource fork size of the file.
Used in example file