Platforms to show: All Mac Windows Linux Cross-Platform

WindowsFileInfoMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Windows MBS Win Plugin 10.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The window file information class.
Example
Var f as FolderItem = SelectFolder

if f<>Nil then
Var w as new WindowsFileInfoMBS(f)
MsgBox str(w.FileIndex)
end if

The identifier that is stored in the FileIndex members is called the file ID. Support for file IDs is file system-specific. File IDs are not guaranteed to be unique over time, because file systems are free to reuse them. In some cases, the file ID for a file can change over time.

In the FAT file system, the file ID is generated from the first cluster of the containing directory and the byte offset within the directory of the entry for the file. Some defragmentation products change this byte offset. (Windows in-box defragmentation does not.) Thus, a FAT file ID can change over time. Renaming a file in the FAT file system can also change the file ID, but only if the new file name is longer than the old one.

In the NTFS file system, a file keeps the same file ID until it is deleted. You can replace one file with another file without changing the file ID by using the ReplaceFile function. However, the file ID of the replacement file, not the replaced file, is retained as the file ID of the resulting file.

Not all file systems can record creation and last access time, and not all file systems record them in the same manner. For example, on a Windows FAT file system, create time has a resolution of 10 milliseconds, write time has a resolution of 2 seconds, and access time has a resolution of 1 day (the access date). On the NTFS file system, access time has a resolution of 1 hour. For more information, see File Times.

Constants

Constant Value Description
kFileAttributeArchive 32 One of the file attribute constants. A file or directory that is an archive file or directory. Applications typically use this attribute to mark files for backup or removal.
kFileAttributeCompressed 2048 One of the file attribute constants. A file or directory that is compressed. For a file, all of the data in the file is compressed. For a directory, compression is the default for newly created files and subdirectories.
kFileAttributeDevice 64 One of the file attribute constants. This value is reserved for system use.
kFileAttributeDirectory 16 One of the file attribute constants. The handle that identifies a directory.
kFileAttributeEncrypted 16384 One of the file attribute constants. A file or directory that is encrypted. For a file, all data streams in the file are encrypted. For a directory, encryption is the default for newly created files and subdirectories.
kFileAttributeHidden 2 One of the file attribute constants. The file or directory is hidden. It is not included in an ordinary directory listing.
kFileAttributeNormal 128 One of the file attribute constants. A file that does not have other attributes set. This attribute is valid only when used alone.
kFileAttributeNotContentIndexed 8192 One of the file attribute constants. The file or directory is not to be indexed by the content indexing service.
kFileAttributeOffline 4096 One of the file attribute constants. The data of a file is not available immediately. This attribute indicates that the file data is physically moved to offline storage. This attribute is used by Remote Storage, which is the hierarchical storage management software. Applications should not arbitrarily change this attribute.
kFileAttributeReadonly 1 One of the file attribute constants. A file that is read-only. Applications can read the file, but cannot write to it or delete it. This attribute is not honored on directories. For more information, see "You cannot view or change the Read-only or the System attributes of folders in Windows Server 2003, in Windows XP, or in Windows Vista".
kFileAttributeReparsePoint 1024 One of the file attribute constants. A file or directory that has an associated reparse point, or a file that is a symbolic link.
kFileAttributeSparseFile 512 One of the file attribute constants. A file that is a sparse file.
kFileAttributeSystem 4 One of the file attribute constants. A file or directory that the operating system uses a part of, or uses exclusively.
kFileAttributeTemporary 256 One of the file attribute constants. A file that is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is available, because typically, an application deletes a temporary file after the handle is closed. In that scenario, the system can entirely avoid writing the data. Otherwise, the data is written after the handle is closed.
kFileAttributeVirtual 65536 One of the file attribute constants. This value is reserved for system use.

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Videos

Release notes

  • Version 18.5

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


WindowsFileDescriptorMBS   -   WindowsFileStreamMBS


The biggest plugin in space...