Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Files.DiskInfo
Queries information about a volume.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Files | 5.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
Mode | What to return. Can be totalBytes or freeBytes. On Windows you can also pass DriveType for type or FreeBytesAvailable to learn available space for current user. On macOS you can query also fileCount, folderCount, blockSize, totalBlocks or freeBlocks. |
"freeBytes" |
PathToVolume | The path to volume. e.g. C:\, \\MyServer\MyDisk\ or /Volumes/testDisk/ or / for root volume on macOS. | / |
Result
Returns value or error.
Description
Queries information about a volume.Please pass native path to volume.
For Windows network volumes with \\ syntax, please include trailing backslash.
DriveType | Description |
Unknown | The drive type cannot be determined. |
Removable | The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader. |
Fixed | The drive has fixed media; for example, a hard disk drive or flash drive. |
Remote | The drive is a remote (network) drive. |
CDROM | The drive is a CD-ROM drive. |
RAMDisk | The drive is a RAM disk. |
Implemented for iOS with 12.4, so you can query totalBytes, freeBytes and createDate.
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
Query free bytes on macOS root volume:
MBS("Files.DiskInfo"; "FreeBytes"; "/")
Query total size of a mounted volume on Mac:
MBS("Files.DiskInfo"; "TotalBytes"; "/Volumes/Ablage1")
Query number of files and folders on Mac:
MBS("Files.DiskInfo"; "FileCount"; "/") & " files and " & MBS("Files.DiskInfo"; "FolderCount"; "/") & " folders."
Query available free bytes on C: for Windows:
MBS("Files.DiskInfo"; "FreeBytesAvailable"; "C:")
Queries size of shared folder in VMWare on Windows:
MBS("Files.DiskInfo"; "TotalBytes"; "\\\\vmware-host\\Shared Folders\\Downloads\\")
// please note the double quoting for backslashes in string constants!
Check drive type on Windows:
MBS( "Files.DiskInfo"; "DriveType"; "C:" )
Queries sizes and free space on root and boot disks on Linux:
MBS( "Files.DiskInfo"; "FreeBytes"; "/" ) & ¶ &
MBS( "Files.DiskInfo"; "TotalBytes"; "/" ) & ¶ &
MBS( "Files.DiskInfo"; "FreeBytes"; "/boot" ) & ¶ &
MBS( "Files.DiskInfo"; "TotalBytes"; "/boot" )
See also
Release notes
- Version 12.4
- Implemented Files.DiskInfo function for iOS.
- Version 11.2
- Fixed Files.DiskInfo for Linux.
- Version 7.3
- Added new option DriveType for Files.DiskInfo on Windows.
Blog Entries
- Neues MBS Plugin 12.4 für Claris FileMaker
- MBS Plugin 12.4 for Claris FileMaker
- MBS FileMaker Plugin, version 12.4pr1
- MBS FileMaker Plugin, version 11.2pr6
- MBS FileMaker Plugin, version 7.3pr4
- MBS FileMaker Plugin 5.0 for OS X/Windows - More than 3000 Functions In One Plugin
- MBS FileMaker Plugin, version 5.0pr10
This function checks for a license.
Created 3th February 2015, last changed 21st July 2022