The methods you need are humorously unlisted in the public methods section, but the technique is documented in the Synopsis:
$ref = new VirtualFS::ISO9660('file.iso') or die "Can't open file.
+iso: $!";
$ref->opendir($dh, '/') or die "Can't open rootdir in file.iso";
# NOTE! ONLY THE 3-ARGUMENT FORM OF open IS SUPPORTED!
$ref->open($fh, '<', '/MANIFEST');
print "the MANIFEST file contains:\n";
# this will have to do until perl adds STAT support for tied fileh
+andles
@stats1 = tied($fh)->STAT;
@stats2 = $ref->stat('/MANIFEST');
while (<$fh>) {
print "$_\n";
}
# unlike closedir, $fh is a "real" (tied) filehandle, and you clos
+e it
# normally.
close $fh;
So it seems you replace the hard-coded "/MANIFEST"with the fully-qualified filename you want off the .iso file and read the thing.
Comments somewhere in the documentation do indicate that there is no concept of a current working directory and all filename references must be fully qualified from root.
Finally, the documentation says binmodedoesn't work, so I'm not sure if you need to switch to something like sysread()to properly read a binary file. But if you're playing with ISO-9660 file systems in Perl, I have to believe you're clever enough to play with it and test it.
I'd test it myself, but ironically and freakishly, I have access to no .iso files in my current location.
|