Hal::Cdroms - access cdroms through HAL and D-Bus
use Hal::Cdroms; my $hal_cdroms = Hal::Cdroms->new; foreach my $hal_path ($hal_cdroms->list) { my $m = $hal_cdroms->get_mount_point($hal_path); print "$hal_path ", $m ? "is mounted in $m" : "is not mounted", "\n"; } my $hal_path = $hal_cdroms->wait_for_insert; my $m = $hal_cdroms->mount($hal_path); print "$hal_path is now mounted in $m\n";
Access cdroms through HAL and D-Bus.
Creates the object
Returns the list of hal_path of the cdroms (mounted or not).
hal_path
Return the mount point associated to the hal_path, or undef it is not mounted.
Mount the hal_path if not already mounted. Return the mount point associated to the hal_path, or undef it cannot be mounted successfully (see $hal_cdroms->{error}).
Mount the hal_path through HAL Return the mount point associated to the hal_path, or undef it cannot be mounted successfully (see $hal_cdroms->{error}). If the cdrom is listed in fstab, HAL will refuse to mount it.
Mount the hal_path through HAL or fallback to plain mount(8). Return the mount point associated to the hal_path, or undef it cannot be mounted successfully (see $hal_cdroms->{error})
Unmount the hal_path. Return true on success (see $hal_cdroms->{error} on failure) If the cdrom is listed in not mounted by HAL, HAL will refuse to unmount it.
Unmount the hal_path through HAL or fallback on umount(8). Return true on success (see $hal_cdroms->{error} on failure)
Ejects the hal_path. Return true on success (see $hal_cdroms->{error} on failure)
Waits until a cdrom is inserted. Returns the inserted hal_path on success. Otherwise returns undef.
You can give an optional timeout in milliseconds.
Waits until a cdrom is inserted and mounted by a volume manager (eg: gnome-volume-manager). Returns the mounted hal_path on success. Otherwise returns undef.
Pascal Rigaux <pixel@mandriva.com>
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.