Hal::Cdroms - access removable media containing CD filesystems through UDisks2 and D-Bus
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";
Access removable media containing CD filesystems (iso9660 and udf) through UDisks2 and D-Bus. This includes CD-ROMS, DVD-ROMS, and USB flash drives.
Creates the object
Return the list of udisks_path of the removable media (mounted or not).
udisks_path
Return the mount point associated to the udisks_path, or undef it is not mounted.
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}).
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}).
Unmount the udisks_path through UDisks2. Return true on success (see $cdroms->{error} on failure)
Eject the udisks_path. Return true on success (see $cdroms->{error} on failure).
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.
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.
Pascal Rigaux <pixel@mandriva.com> Thierry Vignaud <thierry.vignaud@gmail.com> Martin Whitaker <martinw@mageia.org>
To install Hal::Cdroms, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hal::Cdroms
CPAN shell
perl -MCPAN -e shell install Hal::Cdroms
For more information on module installation, please visit the detailed CPAN module installation guide.