Provides information about the currently mounted storage and drives. More...
Import Statement: | import ArcGIS.AppFramework 1.0 |
Inherits: |
Properties
- bytesAvailable : int
- bytesFree : int
- bytesTotal : int
- device : string
- displayName : string
- fileSystemType : string
- folder : FileFolder
- isReadOnly : bool
- isReady : bool
- isRoot : bool
- isValid : bool
- mountedVolumes : List<StorageInfo>
- name : string
- path : string
- storageType : StorageType
- url : url
Signals
- volumeDidMount(string path)
- volumeDidUnMount(string path)
Methods
- refresh()
- bool unmountAndEject(string path)
Detailed Description
The StorageInfo component allows an app to retrieve information about a designated volume's space, mount point, and filesystem name. It can be created by passing the path to the storage volume as a constructor parameter.
The following code snippet demonstrates a potential usage of the StorageInfo component.
App { id: app width: 400 height: 640 Text { anchors { top:parent.top horizontalCenter: parent.horizontalCenter margins: 20 } text:"StorageInfo Details" font.pointSize: 25 } Text { id:content anchors.fill: parent text: "path:" + storageInfo.path + "\n url:" + storageInfo.url + "\n device is:"+ storageInfo.device + "\n filesystem type is: "+ storageInfo.fileSystemType+ "\n name is:"+ storageInfo.name + "\n Is Root:"+ storageInfo.isRoot + "\n Is Valid:"+ storageInfo.isValid+ "\n Is ReadOnly:"+ storageInfo.isReadOnly+ "\n bytes Free:"+ (storageInfo.bytesFree/1000000000).toFixed(2)+ " GB"+ "\n bytes Total:"+ (storageInfo.bytesTotal/1000000000).toFixed(2)+ " GB"+ "\n Volumes:"+ storageInfo.mountedVolumes.length font.pointSize: 16 color: "green" wrapMode: Text.WrapAtWordBoundaryOrAnywhere horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter elide: Text.ElideRight anchors.margins: 10 } StorageInfo { id:storageInfo path:AppFramework.userHomePath } }
Enumerations
StorageType enumeration
Name | Value |
---|---|
StorageInfo.StorageTypeUnknown | -1 |
StorageInfo.StorageTypeInternal | 0 |
StorageInfo.StorageTypeNetwork | 1 |
StorageInfo.StorageTypeRemovable | 2 |
Property Documentation
Returns the number of bytes available for the current user. If no quotas apply to the user, it will return the total size available in the storage.
If there is no attached storage, returns -1.
Returns the number of free bytes in a volume, regardless of user access. This means that, if there are quotas on the file system, this number can be larger than BytesAvailable.
If there is no attached storage, returns -1.
Theturns the total volume size in bytes. If there is no attached storage, returns -1.
Returns the device for this volume. For example, on Unix filesystems like OS X this may appear like /dev/sda0.
If possible, returns the volume's name. Otherwise, returns the root path.
Returns the type name of the filesystem. These are platform-dependent, and can vary between operating systems, e.g. NTFS for Windows or ntfs-3g for Linux.
[read-only] folder : FileFolder |
Returns the volume's folder contents.
Returns true if the current filesystem is protected from writing; otherwise, returns false.
Returns true if the current filesystem is ready to work. Otherwise, returns false.
Returns true if this strage represents the system root volume. Otherwise, returns false. For example, in Unix filesystems, the root volume is mounted on /. On Windows, the root volume is where the OS is installed.
Returns true if the storage specified by path exists and is mounted correctly.
[read-only] mountedVolumes : List<StorageInfo> |
Returns the list of currently mounted filesystems. For example, in Windows returns the drives available in My Computer.
Returns the human-readable name of the filesystem. Not all filesystems support this feature; if they do not, or have not set a name, value returned is empty.
Signal Documentation
Signal emitted when a new mounted volume or removable device has been added.
This signal is supported on Windows, macOS, and Android devices.
Note: The corresponding handler is onVolumeDidMount
.
Signal emitted when a new mounted volume or removable device has been removed.
This signal is supported on Windows, macOS, and Android devices.
Note: The corresponding handler is onVolumeDidUnMount
.
Method Documentation
Unmounts and ejects the removable drive defined by the path parameter.
This method is only supported on Windows and macOS devices.
The path parameter
The filepath to the volume you intend to dismount.