Mount

The gio.mount.Mount interface represents user-visible mounts. Note, when porting from GnomeVFS, gio.mount.Mount is the moral equivalent of GnomeVFSVolume.

gio.mount.Mount is a ‘mounted’ filesystem that you can access. Mounted is in quotes because it’s not the same as a UNIX mount, it might be a GVFS mount, but you can still access the files on it if you use GIO. Might or might not be related to a volume object.

Unmounting a gio.mount.Mount instance is an asynchronous operation. For more information about asynchronous operations, see gio.async_result.AsyncResult and gio.task.Task. To unmount a gio.mount.Mount instance, first call gio.mount.Mount.unmountWithOperation with (at least) the gio.mount.Mount instance and a gio.types.AsyncReadyCallback. The callback will be fired when the operation has resolved (either with success or failure), and a gio.async_result.AsyncResult structure will be passed to the callback. That callback should then call gio.mount.Mount.unmountWithOperationFinish with the gio.mount.Mount and the gio.async_result.AsyncResult data to see if the operation was completed successfully. If an error is present when gio.mount.Mount.unmountWithOperationFinish is called, then it will be filled with any error information.

interface Mount {}

Members

Functions

canEject
bool canEject()

Checks if mount can be ejected.

canUnmount
bool canUnmount()

Checks if mount can be unmounted.

connectChanged
ulong connectChanged(T callback, Flag!"After" after)

Connect to Changed signal.

connectPreUnmount
ulong connectPreUnmount(T callback, Flag!"After" after)

Connect to PreUnmount signal.

connectUnmounted
ulong connectUnmounted(T callback, Flag!"After" after)

Connect to Unmounted signal.

eject
void eject(gio.types.MountUnmountFlags flags, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Ejects a mount. This is an asynchronous operation, and is finished by calling gio.mount.Mount.ejectFinish with the mount and #GAsyncResult data returned in the callback.

ejectFinish
bool ejectFinish(gio.async_result.AsyncResult result)

Finishes ejecting a mount. If any errors occurred during the operation, error will be set to contain the errors and false will be returned.

ejectWithOperation
void ejectWithOperation(gio.types.MountUnmountFlags flags, gio.mount_operation.MountOperation mountOperation, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Ejects a mount. This is an asynchronous operation, and is finished by calling gio.mount.Mount.ejectWithOperationFinish with the mount and #GAsyncResult data returned in the callback.

ejectWithOperationFinish
bool ejectWithOperationFinish(gio.async_result.AsyncResult result)

Finishes ejecting a mount. If any errors occurred during the operation, error will be set to contain the errors and false will be returned.

getDefaultLocation
gio.file.File getDefaultLocation()

Gets the default location of mount. The default location of the given mount is a path that reflects the main entry point for the user (e.g. the home directory, or the root of the volume).

getDrive
gio.drive.Drive getDrive()

Gets the drive for the mount.

getIcon
gio.icon.Icon getIcon()

Gets the icon for mount.

getName
string getName()

Gets the name of mount.

getRoot
gio.file.File getRoot()

Gets the root directory on mount.

getSortKey
string getSortKey()

Gets the sort key for mount, if any.

getSymbolicIcon
gio.icon.Icon getSymbolicIcon()

Gets the symbolic icon for mount.

getUuid
string getUuid()

Gets the UUID for the mount. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns null if there is no UUID available.

getVolume
gio.volume.Volume getVolume()

Gets the volume for the mount.

guessContentType
void guessContentType(bool forceRescan, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Tries to guess the type of content stored on mount. Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info

specification for more on x-content types.

guessContentTypeFinish
string[] guessContentTypeFinish(gio.async_result.AsyncResult result)

Finishes guessing content types of mount. If any errors occurred during the operation, error will be set to contain the errors and false will be returned. In particular, you may get an gio.types.IOErrorEnum.NotSupported if the mount does not support content guessing.

guessContentTypeSync
string[] guessContentTypeSync(bool forceRescan, gio.cancellable.Cancellable cancellable)

Tries to guess the type of content stored on mount. Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info

specification for more on x-content types.

isShadowed
bool isShadowed()

Determines if mount is shadowed. Applications or libraries should avoid displaying mount in the user interface if it is shadowed.

remount
void remount(gio.types.MountMountFlags flags, gio.mount_operation.MountOperation mountOperation, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Remounts a mount. This is an asynchronous operation, and is finished by calling gio.mount.Mount.remountFinish with the mount and #GAsyncResults data returned in the callback.

remountFinish
bool remountFinish(gio.async_result.AsyncResult result)

Finishes remounting a mount. If any errors occurred during the operation, error will be set to contain the errors and false will be returned.

shadow
void shadow()

Increments the shadow count on mount. Usually used by #GVolumeMonitor implementations when creating a shadow mount for mount, see gio.mount.Mount.isShadowed for more information. The caller will need to emit the #GMount::changed signal on mount manually.

unmount
void unmount(gio.types.MountUnmountFlags flags, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Unmounts a mount. This is an asynchronous operation, and is finished by calling gio.mount.Mount.unmountFinish with the mount and #GAsyncResult data returned in the callback.

unmountFinish
bool unmountFinish(gio.async_result.AsyncResult result)

Finishes unmounting a mount. If any errors occurred during the operation, error will be set to contain the errors and false will be returned.

unmountWithOperation
void unmountWithOperation(gio.types.MountUnmountFlags flags, gio.mount_operation.MountOperation mountOperation, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Unmounts a mount. This is an asynchronous operation, and is finished by calling gio.mount.Mount.unmountWithOperationFinish with the mount and #GAsyncResult data returned in the callback.

unmountWithOperationFinish
bool unmountWithOperationFinish(gio.async_result.AsyncResult result)

Finishes unmounting a mount. If any errors occurred during the operation, error will be set to contain the errors and false will be returned.

unshadow
void unshadow()

Decrements the shadow count on mount. Usually used by #GVolumeMonitor implementations when destroying a shadow mount for mount, see gio.mount.Mount.isShadowed for more information. The caller will need to emit the #GMount::changed signal on mount manually.