Skip to main content

TrFile_GetResForkSize (function reference)

Troi File Plug-in > Functions reference > TrFile_GetResForkSize
Troi File Plug-in for FileMaker Pro


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.

SyntaxFunction badge

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

Returned Result

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.

Originated in

Troi File Plug-in 1.0


FileMaker Pro 16 to FileMaker Pro 2023


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.

Example 2

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


Related functionsFunction badge


Related topics

Troi File Plug-in online help (overview)

Online Help Page for Troi File Plug-in for 16 to 2023 –> TrFile_GetResForkSize (filep4244) 2023-0601 15:38:43