Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  

Files.FileSize

Queries file size.

Component: Files
Version: 2.7
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "Files.FileSize"; Path { ; Options } )

Parameters

Parameter Description Example value
Path Native path to the file to check. "C:\test\me.jpg"
Options Optional
Optionally specifies on Mac OS X 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.
"physical datafork"

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 Mac OS X. 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 Mac OS X:

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

Queries physical size of a file on Mac OS X:

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

Queries physical resource fork size of a file on Mac OS X:

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

Queries physical data fork size of a file on Mac OS X:

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

See also


Files.FileName   -   Files.FileUTITypes

Feedback: Report problem or ask question.




Links
MBS Real Studio Plugins - Pfarrgemeinde Ministranten Nickenich