Platforms to show: All Mac Windows Linux Cross-Platform

Back to FileListMBS class.

FileListMBS.AttributeModificationDate(index as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
The attribute modification date of this file or directory.

On Mac OS the UTC date (+0 time zone)
Raises an exception if index is out of bounds. Index is zero based.

See also:

FileListMBS.AttributeModificationDate(index as Integer, UTC as boolean) as Date

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 13.4 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
The attribute modification date of this file or directory.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.

See also:

FileListMBS.AttributeModificationDateTime(index as integer, UTC as boolean) as DateTime

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The attribute modification date of this file or directory.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.BackupDate(index as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 9.1 ✅ Yes ❌ No ❌ No ✅ Yes All
The backup date of this file or directory.

On Mac OS the UTC date (+0 time zone)

See also:

FileListMBS.BackupDate(index as Integer, UTC as boolean) as Date

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 13.4 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
The backup date of this file or directory.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.

See also:

FileListMBS.BackupDateTime(index as integer, UTC as boolean) as DateTime

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The backup date of this file or directory.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.CFURL(index as integer) as Variant

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 19.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Queries CFURLMBS object for an entry.

Returns nil if no CFURL is kept for this item.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destructor.

There is no need to call this method except you want to free all resources of this object now without waiting for Xojo to do it for you.

FileListMBS.Constructor(filelist as FileListMBS, index as Integer, WinFilter as string = "", SkipMode as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 6.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor which creates a new file list based on item in a given file list.
Example
dim f1 as new FileListMBS(SpecialFolder.UserHome)
'MsgBox f1.path

// search first index of a visible folder
dim IndexOfDirectory as integer = 0
while f1.Directory(IndexOfDirectory) = false or f1.Visible(IndexOfDirectory) = false
IndexOfDirectory = IndexOfDirectory + 1
wend

// list that folder
dim f2 as new FileListMBS(f1, IndexOfDirectory)
'MsgBox f2.path

// show first file and path
MsgBox f2.Name(0)+EndOfLine+f2.ItemPath(0)

If count is 0 after the contrustor the folder is invalid or empty.
On Windows the WinFilter allows you to pass a custom filter like "*.txt" to only find some files there.

SkipMode, added in version 20.1, allows you to skip some files from being part of the file list. Please use BitwiseOr() to combine Skip flags, e.g. BitwiseOr(SkipHidden, SkipFolders) returns only visible files.

See also:

FileListMBS.Constructor(folder as folderitem, WinFilter as string = "", SkipMode as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor which creates a new file list based on the folder.

If count is 0 after the contrustor the folder is invalid or empty.
On Windows the WinFilter allows you to pass a custom filter like "*.txt" to only find some files there.

SkipMode, added in version 20.1, allows you to skip some files from being part of the file list. Please use BitwiseOr() to combine Skip flags, e.g. BitwiseOr(SkipHidden, SkipFolders) returns only visible files.

See also:

FileListMBS.Constructor(Path as String, WinFilter as string = "", SkipMode as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 16.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor which creates a new file list based on the directory path.

If count is 0 after the contrustor the directory path is invalid or empty.
On Windows the WinFilter allows you to pass a custom filter like "*.txt" to only find some files there.

SkipMode, added in version 20.1, allows you to skip some files from being part of the file list. Please use BitwiseOr() to combine Skip flags, e.g. BitwiseOr(SkipHidden, SkipFolders) returns only visible files.

See also:

FileListMBS.CreationDate(index as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ❌ No ✅ Yes All
The creation date.

On Mac OS the UTC date (+0 time zone)
On Windows looks like local timezone.

See also:

FileListMBS.CreationDate(index as Integer, UTC as boolean) as Date

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 13.4 ✅ Yes ✅ Yes ❌ No ❌ No Desktop, Console & Web
The creation date.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.

See also:

FileListMBS.CreationDateTime(index as integer, UTC as boolean) as DateTime

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The creation date.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.Creator(index as Integer) as string   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ❌ No ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used.
The Mac Creator code of the item with the given index.

Always "" on Windows and Linux.
Raises an exception if index is out of bounds. Index is zero based.

Stopped working on macOS Monterey and newer since Apple deprecated the API long ago.

FileListMBS.Directory(index as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the item with the given index is a folder.

True if it is a folder and false if it is a file.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.DisplayName(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The display name of the item with the given index.

Asks the System for the display name of the item. Returns the normal name on any error.

As this call may cost quite some CPU time you may cache the value if you need it more often.

May return a Unicode string, so be carefull with encoding.
Returns "" on any error.

Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.FinderFlags(index as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 6.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The Finder flags from Mac OS.

On Windows and Linux value is 0.

The flag value is a set of bits with the following meaning:
bit 15value &H8000isAlias
bit 14value &H4000isInvisible
bit 13value &H2000hasBundle (has a BNDL resource)
bit 12value &H1000nameLocked
bit 11value &H0800isStationary
bit 10value &H0400hasCustomIcon
bit 8value &H0100hasBeenInited (Finder has seen the file since it has been created)
bit 7value &H0080hasNoINITs (there is no INIT rsrc in the Extension file)
bit 6value &H0040isShared
bits 1-3value &H000Ecolor (as a 3-bit value from 0-7)

FileListMBS.FSRef(index as Integer) as memoryblock   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.2 ✅ Yes ❌ No ❌ No ✅ Yes All
This item is deprecated and should no longer be used.
The FSRef used for this item.

Returns nil if no FSRef is kept for this item.
On Mac OS there is a FSSpec or (FSRef and HFSUniStr255).
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.HFSUniStr255(index as Integer) as memoryblock   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.2 ✅ Yes ❌ No ❌ No ✅ Yes All
This item is deprecated and should no longer be used.
The HFSUniStr255 used for this item.

Returns nil if no HFSUniStr255 is kept for this item.
On Mac OS there is a FSSpec or (FSRef and HFSUniStr255).
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.IsBundle(index as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 6.1 ✅ Yes ✅ Yes ❌ No ✅ Yes All
Queries using LaunchServices whether this item is a folder and the root of a bundle.
Example
Protected Sub Dir(f as FolderItem)
dim l as FileListMBS
dim i,c as Integer

// search subfolders and find bundles

l=new FileListMBS(f)
c=l.Count-1
for i=0 to c
// if bundle, show it in listbox
if l.IsBundle(i) then
ListBox1.AddRow l.Item(i).NativePath
elseif l.Directory(i) then
// if sub folder, browse it
dir l.Item(i)
end if
next
End Sub

On Windows, Linux and Mac OS Classic always false.

FileListMBS.IsHardLinked(index as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 9.4 ✅ Yes ❌ No ✅ Yes ✅ Yes All
Whether the file is a hard link.

If two directory entries point to the same hard disc space, you have a file which has two directory entries, but only one storage.

This function returns true for files in a Time Machine backup which did not change since the last backup and share their disc space with the other backups.

Raises an exception if index is out of bounds. Index is zero based.

Some examples using this method:

FileListMBS.Item(index as Integer) as folderitem

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a folderitem for the item with the given index.

Returns nil on any error.
The reason why you use this class is to avoid makeing folderitems which is slow, so don't use this function too often.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.ItemPath(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 16.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The native file path for an item.

Some examples using this method:

FileListMBS.LastAccessDate(index as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last access date of this file or directory.

On Mac OS the UTC date (+0 time zone)
Raises an exception if index is out of bounds. Index is zero based.

To query Spotlight's Last Open day, please check the FAQ for sampel code.

See also:

FileListMBS.LastAccessDate(index as Integer, UTC as boolean) as Date

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The last access date of this file or directory.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.
To query Spotlight's Last Open day, please check the FAQ for sample code.

See also:

FileListMBS.LastAccessDateTime(index as integer, UTC as boolean) as DateTime

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last access date of this file or directory.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.
To query Spotlight's Last Open day, please check the FAQ for sample code.

FileListMBS.LogicalDataLength(index as Integer) as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The logical file data length for the item with the given index.

Same value as folderitem.length, but works with files >2GB.
Raises an exception if index is out of bounds. Index is zero based.

Some examples using this method:

FileListMBS.LogicalResourceLength(index as Integer) as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The logical resource length of the item with the given index.

Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.ModificationDate(index as Integer) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The modification date.

On Mac OS the UTC date (+0 time zone)
On Windows looks like local timezone.
Raises an exception if index is out of bounds. Index is zero based.

See also:

FileListMBS.ModificationDate(index as Integer, UTC as boolean) as Date

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The modification date.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.

See also:

FileListMBS.ModificationDateTime(index as integer, UTC as boolean) as DateTime

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The modification date.

Either in UTC time zone or in local time zone.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.Name(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The name of the item with the given index.

May return a Unicode string, so be carefull with encoding.
Returns "" on any error.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.NodeID(index as Integer) as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 9.1 ✅ Yes ❌ No ✅ Yes ✅ Yes All
The Mac node ID for the given file or directory.

The node id is zero on Windows and Linux.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.ParentDirectoryID(index as Integer) as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 9.1 ✅ Yes ❌ No ✅ Yes ✅ Yes All
The Mac ID for the parent directory.

Parent Directory ID is zero on Windows and Linux.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.PhysicalDataLength(index as Integer) as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The physical data length of the item with the given index.

Returns 0 on any error.
Raises an exception if index is out of bounds. Index is zero based.

Some examples using this method:

FileListMBS.PhysicalResourceLength(index as Integer) as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The physical resource length of the item with the given index.

Value is always 0 on Windows.
Returns 0 on any error.
Raises an exception if index is out of bounds. Index is zero based.

Some examples using this method:

FileListMBS.SortByCreationDate

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 6.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sorts items in list by creation date.

FileListMBS.SortByFileName

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sorts items in list by file names.

FileListMBS.SortByModificationDate

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 6.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sorts items in list by modification date.

FileListMBS.TrueItem(index as Integer) as folderitem

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a folderitem for the item with the given index.

Returns nil on any error.
The reason why you use this class is to avoid makeing folderitems which is slow, so don't use this function too often. e.g. good if you just take 5 folderitems for 20000 files by filtering.

TrueItem will use GetTrueFolderItem so the link/alias files are not resolved by Xojo.
Due to bugs in Xojo, you may still get alias resolved.

Some examples using this method:

FileListMBS.Type(index as Integer) as string   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ❌ No ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used.
The Mac Type code of the item with the given index.

Always "" on Windows and Linux.
Raises an exception if index is out of bounds. Index is zero based.

Stopped working on macOS Monterey and newer since Apple deprecated the API long ago.

FileListMBS.Visible(index as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the item with the given index is visible.

On Mac OS X, files with name starting with "." are considered to be invisible.
False on any error.
Raises an exception if index is out of bounds. Index is zero based.

FileListMBS.WinFileAttributes(index as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Files MBS Util Plugin 6.1 ✅ Yes ✅ Yes ❌ No ✅ Yes All
The file attributes for this file on Windows.

Value is 0 on other platforms.
Raises an exception if index is out of bounds. Index is zero based.

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


The biggest plugin in space...