gnomevfs-0.11.0: Binding to the GNOME Virtual File System library.

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

System.Gnome.VFS.Drive

Contents

Description

 

Synopsis

Types

A container for Volumes.

type DriveID = CULongSource

Identifies a Drive

data DeviceType Source

Identifies the device type of a Volume or Drive.

Type Conversion

Drive Comparison

driveCompareSource

Arguments

:: DriveClass drive 
=> drive

a - the first drive

-> drive

b - the second drive

-> IO Ordering

the ordering relationship between the drives

Compares two DriveClass objects a and b. Two DriveClass objects referring to different drives are guaranteed to not return EQ when comparing them. If they refer to the same drive 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 drives (ZIP, floppy)
  • Optical drives (CD, DVD)
  • External drives (USB sticks, music players)
  • Mounted hard disks
  • Other drives

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

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

Drive Properties

driveGetActivationURISource

Arguments

:: DriveClass drive 
=> drive

drive - the drive object to query

-> IO String

the drive's activation URI

Returns the activation URI of drive.

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

driveGetDevicePathSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive object to query

-> IO (Maybe String)

the drive's device path

Returns the device path of a Drive object.

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

Otherwise, it returns Nothing.

driveGetDeviceTypeSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive object to query

-> IO DeviceType

the drive's device type

Returns the DeviceType of a Drive object.

driveGetDisplayNameSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive object to query

-> IO String

the drive's display name

Returns the display name of a Drive object.

driveGetHalUDISource

Arguments

:: DriveClass drive 
=> drive

drive - the drive object to query

-> IO (Maybe String)

the drive's HAL UDI

Returns the HAL UDI of a Drive object.

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

driveGetIconSource

Arguments

:: DriveClass drive 
=> drive

drive - a drive object

-> IO FilePath

the icon that should be used for this drive

Returns the icon filename for a Drive object.

driveGetIDSource

Arguments

:: DriveClass drive 
=> drive

drive - a drive object

-> IO DriveID

a unique identifier for the drive

Returns a unique identifier for a Drive object.

Drive State

driveIsConnectedSource

Arguments

:: DriveClass drive 
=> drive

drive - a drive object

-> IO Bool

True if the drive is connected, False otherwise

Returns a Bool for whether a drive is connected.

driveIsMountedSource

Arguments

:: DriveClass drive 
=> drive

drive - a drive object

-> IO Bool

True if the drive is mounted, False otherwise

Returns a Bool for whether a drive is mounted.

driveIsUserVisibleSource

Arguments

:: DriveClass drive 
=> drive

drive - a drive object

-> IO Bool

True if the drive is user-visible, False otherwise

Returns a Bool for whether a drive is user-visible. This should be used by applications to determine whether the drive should be listed in user interfaces listing available drives.

driveGetMountedVolumesSource

Arguments

:: DriveClass drive 
=> drive

drive - a drive object

-> IO [Volume]

the Volumes currently mounted on the drive

Returns a list of mounted volumes for a Drive object.

Drive Operations

driveEjectSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive to be ejected

-> VolumeOpSuccessCallback

successCallback - the action to be performed on successful ejection

-> VolumeOpFailureCallback

failureCallback - the action to be performed on failure

-> IO () 

If drive has associated Volume objects, all of them will be unmounted by calling System.Gnome.VFS.Volume.volumeUnmount for each volume in driveGetMountedVolumes, except for the last one, for which System.Gnome.VFS.Volume.volumeEject is called to ensure that the drive's media is ejected.

driveMountSource

Arguments

:: DriveClass drive 
=> drive

drive - a drive object

-> VolumeOpSuccessCallback

successCallback - the action to be performed on successful mount

-> VolumeOpFailureCallback

failureCallback - the action to be performed on failure

-> IO () 

Mounts a Drive object.

Drive Signals

onDriveVolumeMountedSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive to connect the signal handler to

-> (Volume -> IO ())

handler - the signal handling function

-> IO (ConnectId drive)

the identifier for the connection

afterDriveVolumeMountedSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive to connect the signal handler to

-> (Volume -> IO ())

handler - the signal handling function

-> IO (ConnectId drive)

the identifier for the connection

onDriveVolumePreUnmountSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive to connect the signal handler to

-> (Volume -> IO ())

handler - the signal handling function

-> IO (ConnectId drive)

the identifier for the connection

afterDriveVolumePreUnmountSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive to connect the signal handler to

-> (Volume -> IO ())

handler - the signal handling function

-> IO (ConnectId drive)

the identifier for the connection

onDriveVolumeUnmountedSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive to connect the signal handler to

-> (Volume -> IO ())

handler - the signal handling function

-> IO (ConnectId drive)

the identifier for the connection

afterDriveVolumeUnmountedSource

Arguments

:: DriveClass drive 
=> drive

drive - the drive to connect the signal handler to

-> (Volume -> IO ())

handler - the signal handling function

-> IO (ConnectId drive)

the identifier for the connection