6 my $Device = "/dev/cdrom";
7 # !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
8 my $Legal = "!\"#\$&'()*+,-./0123456789:;=?\@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
10 defined($ARGV[0]) && ($Device = $ARGV[0]);
12 my $vol_name = iso_name
($Device);
13 $vol_name =~ s/([\x00-\x20<>\/\x7F-\x9F])/sprintf
("%%%02X", ord($1))/ge;
15 die("$vol_name finnes allerede."); # FIXME.
18 print("Volume: \"$vol_name\"\n");
20 system("mount /cdrom");
22 open(ToFP
, ">$vol_name") || die("$vol_name: Can't create file: $!");
23 open(PipeFP
, "find /cdrom -type f | sort |") || die("Åpning av pipe: $!");
31 system("umount /cdrom");
36 open(DevFP
, "<$Device") || die("$Device: Can't open device for read: $!");
37 seek(DevFP
, 32808, 0) || die("$Device: Can't seek: $!");
38 my $bytes_read = read(DevFP
, $Volname, 32);
39 ($bytes_read == 32) || warn("$Device: Only read $bytes_read byte(s) from device.");