Find file
Fetching contributors…
Cannot retrieve contributors at this time
85 lines (62 sloc) 2.84 KB
Disc::Info
------------
Gets optical disc information from an ISO-format disc (CD/DVD) or ".iso"
image file.
Using this on a physical disc only works in OSes where you can have a
"file" representing the optical drive. So Linux, Unix, Mac OS X, etc.
I'm not sure if this is possible with Windows, if someone knows a way,
let me know. Using it on an .iso file should work on any OS.
= Object Oriented Usage =
Create an object, that offers methods you can query.
use Disc::Info;
my $disc = Disc::Info->get("/dev/cdrom");
say $disc->name." was created in the year ".$disc->date->year;
It offers the following methods:
os The system id of the disc.
name The volume label of the disc.
setid The volume set id (if any) of the disc.
publisher The publisher of the disc.
preparer The person or group who prepared this disc.
appid The application which created this disc.
copyright Copyright information (typically a file to read.)
date Creation date (as a DateTime object.)
created Alias of 'date', see above.
modified Modification date (as a DateTime object.)
effective Effective date (as a DateTime object.)
expires Expiry date (either a DateTime object, or 0 if no expiry.)
filesystem An identifier for the ISO filesystem type.
offset The offset for a given date field ('created' by default.)
In a +/-HHMM format, i.e.: -0800 or +0530
= Procedural Usage =
It returns a hash reference, populated with fields representing the disc info.
use Disc::Info 'get_disc_info';
my $disc = get_disc_info("/dev/cdrom");
say $disc->{name}." was created in the year ".$disc->{cdate}->year;
Offers the following fields:
fs An identifier for the ISO filesystem type.
os The system id of the disc.
name The volume label of the disc.
setid The volume set id (if any) of the disc.
publisher The publisher of the disc.
preparer The person or group who prepared this disc.
appid The application which created this disc.
copyright Copyright information (typically a file to read.)
cdate Creation date (as a DateTime object.)
mdate Modification date (as a DateTime object.)
edate Effective date (as a DateTime object.)
xdate Expiry date (either a DateTime object, or 0 if no expiry.)
coff Creation date timezone offset (in HHMM format.)
moff Modification date timezone offset (in HHMM format).
eoff Effective date timezone offset (in HHMM format.)
xoff Expiry date timezone offset (in HHMM format.)
= Runtime requirements =
* Perl 5 (tested with 5.12.4)
* DateTime (tested with 0.70)
= Testing requirements =
* Test::More
* Test::Exception
= Author =
Timothy Totten
https://github.com/supernovus/
= License =
Artistic License 2.0