StorageInfo QML Type

Provides information about the currently mounted storage and drives. More...

Import Statement: import ArcGIS.AppFramework 1.0
Inherits:

AppFrameworkObject

Properties

Signals

Methods

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

NameValue
StorageInfo.StorageTypeUnknown-1
StorageInfo.StorageTypeInternal0
StorageInfo.StorageTypeNetwork1
StorageInfo.StorageTypeRemovable2

Property Documentation

[read-only] bytesAvailable : int

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.


[read-only] bytesFree : int

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.


[read-only] bytesTotal : int

Theturns the total volume size in bytes. If there is no attached storage, returns -1.


[read-only] device : string

Returns the device for this volume. For example, on Unix filesystems like OS X this may appear like /dev/sda0.


[read-only] displayName : string

If possible, returns the volume's name. Otherwise, returns the root path.


[read-only] fileSystemType : string

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.


[read-only] isReadOnly : bool

Returns true if the current filesystem is protected from writing; otherwise, returns false.


[read-only] isReady : bool

Returns true if the current filesystem is ready to work. Otherwise, returns false.


[read-only] isRoot : bool

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.


[read-only] isValid : bool

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.


[read-only] name : string

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.


path : string

Returns the filepath to the volume.


[read-only] storageType : StorageType


url : url

Returns the URL of the volume.


Signal Documentation

volumeDidMount(string path)

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.


volumeDidUnMount(string path)

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

refresh()

Resets the storage's internal cache.


bool unmountAndEject(string path)

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.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.