NAME
Hal::Cdroms - access removable media containing CD filesystems through UDisks2 and D-Bus
SYNOPSIS
use Hal::Cdroms;
my $cdroms = Hal::Cdroms->new;
foreach my $udisks_path ($cdroms->list) {
my $m = $cdroms->get_mount_point($udisks_path);
print "$udisks_path ", $m ? "is mounted in $m" : "is not mounted", "\n";
}
my $udisks_path = $cdroms->wait_for_insert;
my $m = $cdroms->mount($udisks_path);
print "$udisks_path is now mounted in $m\n";
DESCRIPTION
Access removable media containing CD filesystems (iso9660 and udf) through UDisks2 and D-Bus. This includes CD-ROMS, DVD-ROMS, and USB flash drives.
Hal::Cdroms->new
Creates the object
$cdroms->list
Return the list of udisks_path
of the removable media (mounted or not).
$cdroms->get_mount_point($udisks_path)
Return the mount point associated to the udisks_path
, or undef it is not mounted.
$cdroms->ensure_mounted($udisks_path)
Mount the udisks_path
if not already mounted. Return the mount point associated to the udisks_path
, or undef it cannot be mounted successfully (see $cdroms->{error}).
$cdroms->mount($udisks_path)
Mount the udisks_path
through UDisks2. Return the mount point associated to the udisks_path
, or undef it cannot be mounted successfully (see $cdroms->{error}).
$cdroms->unmount($udisks_path)
Unmount the udisks_path
through UDisks2. Return true on success (see $cdroms->{error} on failure)
$cdroms->eject($udisks_path)
Eject the udisks_path
. Return true on success (see $cdroms->{error} on failure).
$cdroms->wait_for_insert([$timeout])
Wait until media containing a CD filesystem is inserted. Return the inserted udisks_path
on success. Otherwise return undef.
You can give an optional timeout in milliseconds.
$cdroms->wait_for_mounted([$timeout])
Wait until media containing a CD filesystem is inserted and mounted by a volume manager (eg: gnome-volume-manager). Return the mounted udisks_path
on success. Otherwise return undef.
You can give an optional timeout in milliseconds.
AUTHOR
Pascal Rigaux <pixel@mandriva.com> Thierry Vignaud <thierry.vignaud@gmail.com> Martin Whitaker <martinw@mageia.org>