Returns the size for the folder specified by the folderPath. The size is the total size of all the files in the folder and subfolders.
TrFile_GetFolderSize ( switches ; folderPath )
|switches||this modifies the behavior of the function|
|folderPath||the path to the folder for which you want the information|
Switches can be empty or one or the following:
|-SkipInvisibles||don’t add the size of invisible (hidden) files to the returned size|
Data type returned
The size (in number of bytes) of the folder.
Troi File Plug-in 9.0
FileMaker Pro 16 to FileMaker Pro 2023
You can use FileMaker styled paths, like “filewin:/C:/MyFiles/MyFolder”.
v15.0 adds the -SkipInvisibles switch: if you add this switch the plug-in will not add the size of invisible (hidden) files to the returned size. Invisible files are files with hidden attribute or files with a filename that starts with a period. See also the ListFolder.fmp12 example file.
Assume there is a folder “MyData” with several files in it. Then add this to a script:
Set Variable [ $FolderSize; TrFile_GetFolderSize ("-Unused" ; "Mydisk:MyData" ) ]
This might return 1048576 (= 1 Mb) which is the total of the file sizes of the files in the folder.
Set Variable [ $FolderPath; "Mydisk:MyData" ) ] Set Variable [ $FolderSize; TrFile_GetFolderSize ("-SkipInvisibles" ; $FolderPath ) ]
This might return 1040003 which is the total of the file sizes of the files in the folder, without the invisible files.
Used in example file