Gtk2HsContentsIndex
System.Gnome.VFS.Volume
Maintainergtk2hs-devel@lists.sourceforge.net Stability : alpha Portability : portable (depends on GHC)
Contents
Types
Volume Operations
Description
Synopsis
data Volume
class GObjectClass o => VolumeClass o
type VolumeID = CULong
castToVolume :: GObjectClass obj => obj -> Volume
volumeCompare :: (VolumeClass volume1, VolumeClass volume2) => volume1 -> volume2 -> IO Ordering
volumeEject :: VolumeClass volume => volume -> VolumeOpSuccessCallback -> VolumeOpFailureCallback -> IO ()
volumeGetActivationURI :: VolumeClass volume => volume -> IO TextURI
volumeGetDevicePath :: VolumeClass volume => volume -> IO String
volumeGetDeviceType :: VolumeClass volume => volume -> IO DeviceType
volumeGetDisplayName :: VolumeClass volume => volume -> IO String
volumeGetDrive :: VolumeClass volume => volume -> IO Drive
volumeGetFilesystemType :: VolumeClass volume => volume -> IO (Maybe String)
volumeGetHalUDI :: VolumeClass volume => volume -> IO (Maybe String)
volumeGetIcon :: VolumeClass volume => volume -> IO FilePath
volumeGetID :: VolumeClass volume => volume -> IO VolumeID
volumeGetVolumeType :: VolumeClass volume => volume -> IO VolumeType
volumeHandlesTrash :: VolumeClass volume => volume -> IO Bool
volumeIsMounted :: VolumeClass volume => volume -> IO Bool
volumeIsReadOnly :: VolumeClass volume => volume -> IO Bool
volumeIsUserVisible :: VolumeClass volume => volume -> IO Bool
volumeUnmount :: VolumeClass volume => volume -> VolumeOpSuccessCallback -> VolumeOpFailureCallback -> IO ()
Types
An abstraction for a mounted filesystem or network location.
data Volume
show/hide Instances
class GObjectClass o => VolumeClass o
show/hide Instances
type VolumeID = CULong
Identifies a Volume.
Safely cast an object to a Volume.
castToVolume :: GObjectClass obj => obj -> Volume
Volume Operations
volumeCompare :: (VolumeClass volume1, VolumeClass volume2) => volume1 -> volume2 -> IO Ordering

Compares two Volume objects a and b. Two Volume objects referring to different volumes are guaranteed to not return EQ when comparing them. If they refer to the same volume EQ is returned.

The resulting gint should be used to determine the order in which a and b are displayed in graphical user interfaces.

The comparison algorithm first of all peeks the device type of a and b, they will be sorted in the following order:

  • Magnetic and opto-magnetic volumes (ZIP, floppy)
  • Optical volumes (CD, DVD)
  • External volumes (USB sticks, music players)
  • Mounted hard disks
  • Network mounts
  • Other volumes

Afterwards, the display name of a and b is compared using a locale-sensitive sorting algorithm.

If two volumes have the same display name, their unique ID is compared which can be queried using volumeGetID.

volumeEject
:: VolumeClass volume
=> volumevolume - the volume to eject
-> VolumeOpSuccessCallbacksuccessCallback - the callback to call once the operation has completed successfully
-> VolumeOpFailureCallbackfailureCallback - the callback to call if the operation fails
-> IO ()
volumeGetActivationURI
:: VolumeClass volume
=> volumevolume - the volume to query
-> IO TextURIthe volume's activation URI.

Returns the activation URI of volume.

The returned URI usually refers to a valid location. You can check the validity of the location by calling uriFromString with the URI, and checking whether the return value is not Nothing.

volumeGetDevicePath
:: VolumeClass volume
=> volumevolume - the volume object to query
-> IO Stringthe volume's device path

Returns the device path of a Volume object.

For HAL volumes, this returns the value of the volume's block.device key. For UNIX mounts, it returns the mntent's mnt_fsname entry.

Otherwise, it returns Nothing.

volumeGetDeviceType
:: VolumeClass volume
=> volumevolume - the volume object to query
-> IO DeviceType
Returns the DeviceType of a Volume object.
volumeGetDisplayName
:: VolumeClass volume
=> volumevolume - the volume object to query
-> IO Stringthe volume's display name
Returns the display name of a Volume object.
volumeGetDrive
:: VolumeClass volume
=> volumevolume - the volume object to query
-> IO Drivethe containing drive
Returns the Drive that volume is on.
volumeGetFilesystemType
:: VolumeClass volume
=> volumevolume - the volume object to query
-> IO (Maybe String)a string describing the filesystem type, or Nothing if no information is available

Returns a string describing the file system on volume, or Nothing if no information on the underlying file system is available.

The file system may be used to provide special functionality that depends on the file system type, for instance to determine whether trashing is supported (cf. volumeHandlesTrash).

For HAL mounts, this returns the value of the "volume.fstype" key, for traditional UNIX mounts it is set to the mntent's mnt_type key, for connected servers, Nothing is returned.

volumeGetHalUDI
:: VolumeClass volume
=> volumevolume - the volume object to query
-> IO (Maybe String)the volume's HAL UDI

Returns the HAL UDI of a Volume object.

For HAL volumes, this matches the value of the info.udi key, for other volumes it is Nothing.

volumeGetIcon
:: VolumeClass volume
=> volumevolume - a volume object
-> IO FilePaththe icon that should be used for this volume
Returns the icon filename for a Volume object.
volumeGetID
:: VolumeClass volume
=> volumevolume - a volume object
-> IO VolumeIDa unique identifier for the volume
Returns a unique identifier for a Volume object.
volumeGetVolumeType
:: VolumeClass volume
=> volumevolume - the volume object to query
-> IO VolumeTypethe volume's volume type
Returns the volume type of volume.
volumeHandlesTrash
:: VolumeClass volume
=> volumevolume -
-> IO BoolTrue if the volume handles trash, otherwise False

Returns whether the file system on a volume supports trashing of files.

If the volume has an AutoFS file system (i.e., volumeGetDeviceType returns DeviceTypeAutofs), or if the volume is mounted read-only (i.e., volumeIsReadOnly returns True), it is assumed to not support trashing of files.

Otherwise, if the volume provides file system information, it is determined whether the file system supports trashing of files.

volumeIsMounted
:: VolumeClass volume
=> volumevolume -
-> IO BoolTrue if the volume is mounted, otherwise False

Returns whether the file system on a volume is currently mounted.

For HAL volumes, this reflects the value of the "volume.is_mounted" key, for traditional UNIX mounts and connected servers, True is returned, because their existence implies that they are mounted.

volumeIsReadOnly
:: VolumeClass volume
=> volumevolume -
-> IO BoolTrue if the volume is read-only, otherwise False

Returns whether the file system on a volume is read-only.

For HAL volumes, the "volume.is_mounted_read_only" key is authoritative, for traditional UNIX mounts it returns TRUE if the mount was done with the "ro" option. For servers, False is returned.

volumeIsUserVisible
:: VolumeClass volume
=> volume
-> IO BoolTrue if the volume is user visible, otherwise False
Returns a Bool for whether a volume is user-visible. This should be used by applications to determine whether the volume should be listed in user interfaces listing available volumes.
volumeUnmount
:: VolumeClass volume
=> volumevolume - the volume to eject
-> VolumeOpSuccessCallbacksuccessCallback - the callback to call once the operation has completed successfully
-> VolumeOpFailureCallbackfailureCallback - the callback to call if the operation fails
-> IO ()
Produced by Haddock version 0.8