gio-0.12.2: Binding to the GIO.

Portabilityportable (depends on GHC)
Stabilityalpha
Maintainergtk2hs-devel@lists.sourceforge.net

System.GIO.Volumes.Mount

Contents

Description

 

Synopsis

Details

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

Mount is a mounted filesystem that you can access. Mounted is in quotes because it's not the same as a 1 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 Mount instance is an asynchronous operation. For more information about asynchronous operations, see AsyncReady and GSimpleAsyncReady. To unmount a Mount instance, first call mountUnmountWithOperation the Mount instance and a AsyncReadyCallback. The callback will be fired when the operation has resolved (either with success or failure), and a AsyncReady structure will be passed to the callback. That callback should then call mountUnmountWithOperationFinish with the Mount and the AsyncReady data to see if the operation was completed successfully. If an error is present when mountUnmountWithOperationFinish is called, then it will be filled with any error information.

Types

Methods

mountGetNameSource

Arguments

:: MountClass mount 
=> mount 
-> IO String

returns the name for the given mount.

Gets the name of mount.

mountGetUUIDSource

Arguments

:: MountClass mount 
=> mount 
-> IO (Maybe String)

returns the UUID for mount or Nothing if no UUID can be computed.

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 Nothing if there is no UUID available.

mountGetIconSource

Arguments

:: MountClass mount 
=> mount 
-> IO Icon

returns a Icon.

Gets the icon for mount.

mountGetDriveSource

Arguments

:: MountClass mount 
=> mount 
-> IO (Maybe Drive)

returns the Drive for mount or Nothing if no Drive can be computed.

Gets the drive for the mount.

This is a convenience method for getting the Volume and then using that object to get the Drive.

mountGetRoot :: MountClass mount => mount -> IO FileSource

Gets the root directory on mount.

mountGetVolumeSource

Arguments

:: MountClass mount 
=> mount 
-> IO (Maybe Volume)

returns a Volume or Nothing if mount is not associated with a volume.

Gets the volume directory on mount.

mountGetDefaultLocation :: MountClass mount => mount -> IO FileSource

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). | Gets the root directory on mount.

mountCanUnmountSource

Arguments

:: MountClass mount 
=> mount 
-> IO Bool

returns True if the mount can be unmounted.

Checks if mount can be mounted.

mountUnmountWithOperationSource

Arguments

:: MountClass mount 
=> mount 
-> [MountUnmountFlags]

flags flags affecting the unmount if required for eject

-> Maybe MountOperation

mountOperation a MountOperation or Nothing to avoid user interaction.

-> Maybe Cancellable

cancellable optional Cancellable object, Nothing to ignore.

-> AsyncReadyCallback

callback a AsyncReadyCallback

-> IO () 

Unmounts a mount. This is an asynchronous operation, and is finished by calling mountUnmountWithOperationFinish with the mount and AsyncResult data returned in the callback.

mountUnmountWithOperationFinishSource

Arguments

:: MountClass mount 
=> mount 
-> AsyncResult

result a AsyncResult.

-> IO () 

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

Throws a GError if an error occurs.

mountRemountSource

Arguments

:: MountClass mount 
=> mount 
-> [MountMountFlags]

flags flags affecting the unmount if required for eject

-> Maybe MountOperation

mountOperation a MountOperation or Nothing to avoid user interaction.

-> Maybe Cancellable

cancellable optional Cancellable object, Nothing to ignore.

-> AsyncReadyCallback

callback a AsyncReadyCallback

-> IO () 

Remounts a mount. This is an asynchronous operation, and is finished by calling mountRemountFinish with the mount and AsyncResults data returned in the callback.

Remounting is useful when some setting affecting the operation of the volume has been changed, as these may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting not all backends might need to actually be unmounted.

mountRemountFinishSource

Arguments

:: MountClass mount 
=> mount 
-> AsyncResult

result a AsyncResult.

-> IO () 

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

Throws a GError if an error occurs.

mountCanEjectSource

Arguments

:: MountClass mount 
=> mount 
-> IO Bool

returns True if the mount can be ejected.

Checks if mount can be eject.

mountEjectWithOperationSource

Arguments

:: MountClass mount 
=> mount 
-> [MountUnmountFlags]

flags flags affecting the unmount if required for eject

-> Maybe MountOperation

mountOperation a MountOperation or Nothing to avoid user interaction.

-> Maybe Cancellable

cancellable optional Cancellable object, Nothing to ignore.

-> AsyncReadyCallback

callback a AsyncReadyCallback

-> IO () 

Ejects a mount. This is an asynchronous operation, and is finished by calling mountEjectWithOperationFinish with the mount and AsyncResult data returned in the callback.

mountEjectWithOperationFinishSource

Arguments

:: MountClass mount 
=> mount 
-> AsyncResult

result a AsyncResult.

-> IO () 

Finishes ejecting a mount. If any errors occurred during the operation.

Throws a GError if an error occurs.

mountGuessContentTypeSource

Arguments

:: MountClass mount 
=> mount 
-> Bool

forceRescan Whether to force a rescan of the content. Otherwise a cached result will be used if available

-> Maybe Cancellable

cancellable optional Cancellable object, Nothing to ignore

-> AsyncReadyCallback

callback a AsyncReadyCallback

-> IO () 

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-contentimage-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.

This is an asynchronous operation (see mountGuessContentTypeSync for the synchronous version), and is finished by calling mountGuessContentTypeFinish with the mount and AsyncResult data returned in the callback.

mountGuessContentTypeFinishSource

Arguments

:: MountClass mount 
=> mount 
-> AsyncResult

result a AsyncResult.

-> IO [String]

returns True if the mount was successfully ejected. False otherwise.

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

mountGuessContentTypeSyncSource

Arguments

:: MountClass mount 
=> mount 
-> Bool

forceRescan Whether to force a rescan of the content. Otherwise a cached result will be used if available

-> Maybe Cancellable

cancellable optional Cancellable object, Nothing to ignore

-> IO [String] 

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-contentimage-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.

This is an synchronous operation and as such may block doing IO; see mountGuessContentType for the asynchronous version.

mountIsShadowedSource

Arguments

:: MountClass mount 
=> mount 
-> IO Bool

returns True if mount is shadowed.

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

A mount is said to be shadowed if there exists one or more user visible objects (currently Mount objects) with a root that is inside the root of mount.

One application of shadow mounts is when exposing a single file system that is used to address several logical volumes. In this situation, a VolumeMonitor implementation would create two Volume objects (for example, one for the camera functionality of the device and one for a SD card reader on the device) with activation URIs gphoto2: gphoto2: mounted, said VolumeMonitor implementation would create two Mount objects (each with their root matching the corresponding volume activation root) that would shadow the original mount.

The proxy monitor in GVfs 2.26 and later, automatically creates and manage shadow mounts (and shadows the underlying mount) if the activation root on a Volume is set.

mountShadow :: MountClass mount => mount -> IO ()Source

Increments the shadow count on mount. Usually used by VolumeMonitor implementations when creating a shadow mount for mount, see mountIsShadowed for more information. The caller will need to emit the changed signal on mount manually.

mountUnshadow :: MountClass mount => mount -> IO ()Source

Decrements the shadow count on mount. Usually used by VolumeMonitor implementations when destroying a shadow mount for mount, see mountIsShadowed for more information. The caller will need to emit the changed signal on mount manually.

Signals

mountChanged :: MountClass mount => Signal mount (IO ())Source

Emitted when the mount has been changed.

mountPreUnmount :: MountClass mount => Signal mount (IO ())Source

This signal is emitted when the Mount is about to be unmounted.

mountUnmounted :: MountClass mount => Signal mount (IO ())Source

This signal is emitted when the Mount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.