Platforms to show: All Mac Windows Linux Cross-Platform

Back to DirectorySizeMBS class.

DirectorySizeMBS.Cancel as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the Update function should stop as soon as possible.

(Read and Write property)

DirectorySizeMBS.CompressedSize as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 11.3 ❌ No ✅ Yes ❌ No ❌ No All
The size in bytes of all files.

If a file is compressed, we add here the compressed size.
If a file is not compressed, we add the normal logical size.
Only used on Windows and only with QueryCompressedSizes = true.
(Read only property)

DirectorySizeMBS.CountBundlesAsItem as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 11.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Whether to cound bundles as files.
Example
// chose a folder
Var f as FolderItem = SpecialFolder.Applications

// calculate
Var d1 as new DirectorySizeMBS
d1.CountBundlesAsItem = true

call d1.Update(f, true, 0)

Var d2 as new DirectorySizeMBS
d2.CountBundlesAsItem = false

call d2.Update(f, true, 0)

// display
MsgBox "Normal count: "+str(D2.FilesCount)+" files and "+str(d2.FolderCount)+" folders"+EndOfLine+_
"With bundles as files: "+str(D1.FilesCount)+" files and "+str(d1.FolderCount)+" folders"

Bundles like applications are counted as a single file if this property is true or as a folder with files inside if this property is false.
Default is false.
(Read and Write property)

DirectorySizeMBS.Directory as FolderItem

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The folder which was searched.

(Read and Write property)

DirectorySizeMBS.FilesCount as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The number of files counted.
Example
Var f as FolderItem = SpecialFolder.desktop
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(True,0)
MsgBox str(d.FilesCount)+" files"

FilesCount=VisibleFilesCount+HiddenFilesCount
(Read only property)

DirectorySizeMBS.FolderCount as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The number of folders counted.
Example
Var f as FolderItem = SpecialFolder.desktop
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(True,0)
MsgBox str(d.FolderCount)+" folder"

FolderCount=VisibleFolderCount+HiddenFolderCount
(Read only property)

DirectorySizeMBS.IgnoreHiddenFolderContent as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 4.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
If this flag is set, the Update method will not count invisible files.

(Read and Write property)

DirectorySizeMBS.ItemCount as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The number of items counted.
Example
// chose a folder
Var f as FolderItem = SpecialFolder.Music
// calculate size
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(true,0)

// show number of files
MsgBox str(d.ItemCount)

ItemCount=VisibleItemCount+HiddenItemCount
(Read only property)

DirectorySizeMBS.LogicalDataForkSize as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The logical data fork size in Bytes.
Example
Var f as FolderItem = SpecialFolder.desktop
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(True,0)
MsgBox "Logical data fork size of all files: "+Format(d.LogicalDataForkSize/1000000,"0")+" MB"

(Read only property)

Some examples using this property:

DirectorySizeMBS.LogicalResourceForkSize as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The logical resource fork size in Bytes.

Var f as FolderItem = SpecialFolder.desktop
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(True,0)
MsgBox "Logical resource fork size of all files: "+Format(d.LogicalResourceForkSize/1000000,"0")+" MB"
(Read only property)

Some examples using this property:

DirectorySizeMBS.LogicalTotalSize as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The logical total size in Bytes.
Example
Var f as FolderItem = SpecialFolder.desktop
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(True,0)
MsgBox "Logical total size of all files: "+Format(d.LogicalTotalSize/1000000,"0")+" MB"

(ResourceFork+DataFork)
(Read only property)

Some examples using this property:

DirectorySizeMBS.PhysicalDataForkSize as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The physical data fork size in Bytes.
Example
Var f as FolderItem = SpecialFolder.desktop
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(True,0)
MsgBox "Physical data fork size of all files: "+Format(d.PhysicalDataForkSize/1000000,"0")+" MB"

(Read only property)

Some examples using this property:

DirectorySizeMBS.PhysicalResourceForkSize as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The physical resource fork size in Bytes.
Example
Var f as FolderItem = SpecialFolder.desktop
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(True,0)
MsgBox "Physical resource fork size of all files: "+Format(d.PhysicalResourceForkSize/1000000,"0")+" MB"

(Read only property)

Some examples using this property:

DirectorySizeMBS.PhysicalTotalSize as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The physical total file size in Bytes.
Example
Var f as FolderItem = SpecialFolder.desktop
Var d as DirectorySizeMBS = f.CalculateDirectorySizeMBS(True,0)
MsgBox "Physical total size of all files: "+Format(d.VisiblePhysicalTotalSize/1000000,"0")+" MB"

(ResourceFork+DataFork)
That's what the Finder shows you.
(Read only property)

Some examples using this property:

DirectorySizeMBS.QueryCompressedSizes as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 11.3 ❌ No ✅ Yes ❌ No ❌ No All
Whether to query compressed file sizes on Windows.

(Read and Write property)

DirectorySizeMBS.RecursionLimit as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The limit for recursion.

Default is -1 for no limit.
Zero means we do not recurse into subfolders.
Other values define how many recursion levels are allowed.
(Read and Write property)

DirectorySizeMBS.RecursionMaxLevel as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The maximum levels of recursions we had for searching this folder.

(Read and Write property)

DirectorySizeMBS.YieldTicks as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Files MBS Util Plugin 7.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
How much time is given back to Xojo for other ticks.
Example
Var d as DirectorySizeMBS // your DirectorySizeMBS object
d.YieldTicks=6 // only use 1/10th of a second

If value is greater than zero, the application will yield to another Xojo thread after the given number of ticks have passed. 60 ticks are one second. Using a small value can slow down processing a lot while a big value keeps your application not responding to mouse clicks.
If you use this property with e.g. 6 as the value, you may also want to use this method in a thread so you can handle mouse events or let Xojo redraw a progressbar.
(Read and Write property)

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...