Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Files.FolderSize
Calculate sizes of folder.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Files | 6.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "Files.FolderSize"; Path { ; RecursionLimit; IgnoreHiddenFolderContent; CountBundlesAsItem } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Path | Native file path to folder. | "C:\Test" | |
RecursionLimit | The limit for the recursion. Default is -1 for no limit. Pass zero to only look in files in that folder and not subfolders. |
0 | Optional |
IgnoreHiddenFolderContent | Do not count items in hidden subfolders. Pass 1 to ignore or 0 to count. Default is 0. |
0 | Optional |
CountBundlesAsItem | Count bundles as items. Default is 0 to look inside those bundles, e.g. apps. Pass 1 to count bundles as files. |
1 | Optional |
Result
Returns values or error.
Description
Calculate sizes of folder.On success returns a list of values. Please calculate ones, save result in variable and pick the values you need. It's quite efficient for us to query all those values in one run as disk access is the slowest part here, not summing up the values.
Name | Position | Description | Example |
ItemCount | 1 | Total number of items | 153 |
FilesCount | 2 | Total number of files | 140 |
FolderCount | 3 | Total number of folders. | 13 |
VisibleItemCount | 4 | Number of visible items. | 143 |
HiddenItemCount | 5 | Number of hidden items. | 10 |
VisibleFilesCount | 6 | Number of visible files. | 130 |
HiddenFilesCount | 7 | Number of hidden files. | 10 |
VisibleFolderCount | 8 | Number of visible folders. | 13 |
HiddenFolderCount | 9 | Number of hidden folders. | 0 |
PhysicalTotalSize | 10 | Total physical byte size. | 186777600 |
LogicalTotalSize | 11 | Total logical byte size. | 186581344 |
VisiblePhysicalTotalSize | 12 | Total physical byte size for visible files. | 186679296 |
VisibleLogicalTotalSize | 13 | Total logical byte size for visible files. | 186507445 |
HiddenPhysicalTotalSize | 14 | Total physical byte size for hidden files. | 98304 |
HiddenLogicalTotalSize | 15 | Total logical byte size for hidden files. | 73899 |
PhysicalDataForkSize | 16 | Total physical byte size. | 172150784 |
LogicalDataForkSize | 17 | Total logical byte size. | 171970091 |
VisiblePhysicalDataForkSize | 18 | Total physical data fork byte size for visible files. | 172052480 |
VisibleLogicalDataForkSize | 19 | Total logical data fork byte size for visible files. | 171896192 |
HiddenPhysicalDataForkSize | 20 | Total physical data fork byte size for hidden files. | 98304 |
HiddenLogicalDataForkSize | 21 | Total logical data fork byte size for hidden files. | 73899 |
PhysicalResourceForkSize | 22 | Total physical resource fork byte size. | 14626816 |
LogicalResourceForkSize | 23 | Total logical resource fork byte size. | 14611253 |
VisiblePhysicalResourceForkSize | 24 | Total physical resource fork byte size for visible files. | 14626816 |
VisibleLogicalResourceForkSize | 25 | Total logical resource fork byte size for visible files. | 14611253 |
HiddenPhysicalResourceForkSize | 26 | Total physical resource fork byte size for hidden files. | 0 |
HiddenLogicalResourceForkSize | 27 | Total logical resource fork byte size for hidden files. | 0 |
RecursionMaxLevel | 28 | Maximum recursion level we had. | 3 |
Windows doesn't know about resource fork, so the resource fork sizes are zero there always.
Currently block size calculation for Windows is not done, so logical and physical sizes are identical.
Implemented in version 10.4 for iOS and Linux.
This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.
Examples
Calculate my desktop size:
MBS( "Files.FolderSize"; "/Users/cs/Desktop" )
Caluclate on Windows:
MBS( "Files.FolderSize"; "/Users/cs/Desktop" )
See also
Release notes
- Version 10.4
- Implemented Files.FolderSize for iOS and Linux.
Blog Entries
- MBS FileMaker Plugin, version 10.4pr4
- MBS FileMaker Plugin, version 6.2pr1
- New functions for MBS FileMaker Plugin coming soon
- Calculating folder size
FileMaker Magazin
This function checks for a license.
Created 11st March 2016, last changed 11st August 2020