Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4   11.5   11.6    Statistic    FMM    Blog  

Files.FileSize

Queries file size.

Component Version macOS Windows Linux Server iOS SDK
Files 2.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Files.FileSize"; Path { ; Options } )   More

Parameters

Parameter Description Example Flags
Path Native path to the file to check. "C:\test\me.jpg"
Options Optionally specifies on macOS what size is returned.
Default is total logical file size. Pass datafork or resourcefork to limit query to only size of given fork. And pass physical or logical to query logical size or the physical size, defined by blocks used on Disk.

Pass combination of total, physical, datafork, logical, resourcefork.
"physical datafork" Optional

Result

Returns file size in bytes.

Description

Queries file size.
This function needs a native path. Please use Path.FileMakerPathToNativePath function in order to convert a FileMaker style path to a native path.
With 2.9 plugins you can set parameter to query only size of resource fork or data fork on macOS. And you can define if you want to query size on disk (rounded up to block size) or the logical size.

Examples

Queries file size of a file

MBS( "Files.FileSize"; "C:\test.txt" )

Queries logical data fork size of a file on macOS:

MBS( "Files.FileSize"; "/Users/Shared/Test.txt"; "datafork" )

Queries physical size of a file on macOS:

MBS( "Files.FileSize"; "/Users/Shared/Test.txt"; "physical" )

Queries physical resource fork size of a file on macOS:

MBS( "Files.FileSize"; "/Users/Shared/Test.txt"; "physical-resourcefork" )

Queries physical data fork size of a file on macOS:

MBS( "Files.FileSize"; "/Users/Shared/Test.txt"; "physical datafork" )

See also

Release notes

Example Databases

Blog Entries

FileMaker Magazin

Created 18th August 2014, last changed 6th January 2021


Files.FileNameWithoutExtension - Files.FileUTITypes

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins

Start Chat