mirror of
https://github.com/softwarejanitor/DOS33.git
synced 2025-03-16 06:30:49 +00:00
Added undelete and init
This commit is contained in:
parent
ed14524fbb
commit
a0a7cfb193
26
DOS33.pm
26
DOS33.pm
@ -1157,5 +1157,31 @@ $debug = 1;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Undelete a file
|
||||
#
|
||||
sub undelete_file {
|
||||
my ($dskfile, $filename, $dbg) = @_;
|
||||
|
||||
$debug = 1 if (defined $dbg && $dbg);
|
||||
|
||||
print "dskfile=$dskfile filename=$filename\n";
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#
|
||||
# Initialize a disk image.
|
||||
#
|
||||
sub init {
|
||||
my ($dskfile, $volume, $dbg) = @_;
|
||||
|
||||
$debug = 1 if (defined $dbg && $dbg);
|
||||
|
||||
print "dskfile=$dskfile volume=$volume\n";
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
4
README
4
README
@ -4,10 +4,12 @@ catalog.pl -- mostly working
|
||||
freemap.pl -- mostly working
|
||||
dos33read.pl -- mostly working for simple text files
|
||||
dos33write.pl -- in progress
|
||||
dos33umlock.pl -- mostly working
|
||||
dos33unlock.pl -- mostly working
|
||||
dos33lock.pl -- mostly working
|
||||
dos33rename.pl -- mostly working
|
||||
dos33delete.pl -- in progress
|
||||
dos33copy.pl -- started
|
||||
zap.pl -- partially working
|
||||
dos33undelete.pl -- started
|
||||
dos33init.pl -- started
|
||||
|
||||
|
39
dos33init.pl
Normal file
39
dos33init.pl
Normal file
@ -0,0 +1,39 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
#
|
||||
# dos33init.pl:
|
||||
#
|
||||
# Utility to initialize an Apple II DOS 3.3 disk image.
|
||||
#
|
||||
# 20190310 LSH
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use DOS33;
|
||||
|
||||
my $debug = 0;
|
||||
my $volume = 254;
|
||||
|
||||
while (defined $ARGV[0] && $ARGV[0] =~ /^-/) {
|
||||
# Volume
|
||||
if ($ARGV[0] eq '-v' && defined $ARGV[1] && $ARGV[1] =~ /^\d+$/) {
|
||||
$volume = $ARGV[1];
|
||||
shift;
|
||||
shift;
|
||||
# Debug
|
||||
} elsif ($ARGV[0] eq '-d') {
|
||||
$debug = 1;
|
||||
shift;
|
||||
} else {
|
||||
die "Unknown command line argument $ARGV[0]\n";
|
||||
}
|
||||
}
|
||||
|
||||
my $dskfile = shift or die "Must supply .dsk filename\n";
|
||||
die "Volume must be 1-254\n" if $volume < 1 || $volume > 254;
|
||||
|
||||
init($dskfile, $volume, $debug);
|
||||
|
||||
1;
|
||||
|
33
dos33undelete.pl
Normal file
33
dos33undelete.pl
Normal file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
#
|
||||
# dos33undelete.pl:
|
||||
#
|
||||
# Utility to undelete a file on an Apple II DOS 3.3 disk image.
|
||||
#
|
||||
# 20190310 LSH
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use DOS33;
|
||||
|
||||
my $debug = 0;
|
||||
|
||||
while (defined $ARGV[0] && $ARGV[0] =~ /^-/) {
|
||||
# Debug
|
||||
if ($ARGV[0] eq '-d') {
|
||||
$debug = 1;
|
||||
shift;
|
||||
} else {
|
||||
die "Unknown command line argument $ARGV[0]\n";
|
||||
}
|
||||
}
|
||||
|
||||
my $dskfile = shift or die "Must supply .dsk filename\n";
|
||||
my $filename = shift or die "Must supply filename (on disk image)\n";
|
||||
|
||||
undelete_file($dskfile, $filename, $debug);
|
||||
|
||||
1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user