Added dos33 delete, unlock, lock

This commit is contained in:
Leeland Heins 2019-01-17 06:53:56 -06:00 committed by GitHub
parent 2878de46a2
commit 67b9218488
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 113 additions and 6 deletions

View File

@ -412,7 +412,9 @@ sub get_tslist {
my ($dskfile, $tslist_trk, $tslist_sec) = @_;
my ($next_tslist_trk, $next_tslist_sec) = ($tslist_trk, $tslist_sec);
my @secs = ();
do {
($next_tslist_trk, $next_tslist_sec, @secs) = get_tslist_sec($dskfile, $next_tslist_trk, $next_tslist_sec);
if (defined $next_tslist_trk && $next_tslist_trk ne '') {
@ -459,9 +461,7 @@ sub read_file {
$mode = '' unless defined $mode;
$conv = 0 unless defined $conv;
if (defined $dbg && $dbg) {
$debug = 1;
}
$debug = 1 if (defined $dbg && $dbg);
my ($trk, $sec) = find_file($dskfile, $filename);
if ($trk) {
@ -490,5 +490,25 @@ sub read_file {
}
}
sub unlock_file {
my ($dskfile, $filename, $dbg) = @_;
$debug = 1 if (defined $dbg && $dbg);
##FIXME -- need to make find_file return catalog t/s & file offset.
}
sub lock_file {
my ($dskfile, $filename, $dbg) = @_;
$debug = 1 if (defined $dbg && $dbg);
}
sub delete_file {
my ($dskfile, $filename, $dbg) = @_;
$debug = 1 if (defined $dbg && $dbg);
}
1;

6
README
View File

@ -4,10 +4,10 @@ catalog.pl -- mostly working
freemap.pl -- mostly working
dos33read.pl -- mostly working for simple text files
dos33write.pl
dos33umlock.pl
dos33lock.pl
dos33umlock.pl -- started
dos33lock.pl -- started
dos33rename.pl
dos33delete.pl
dos33delete.pl -- started
dos33copy.pl
zap.pl -- partially working
prozap.pl -- partially working

29
dos33delete.pl Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/perl -w
#
# dos33delete.pl:
#
# Utility to delete a file on an Apple II DOS 3.3 disk image.
#
# 20190116 LSH
#
use strict;
use DOS33;
while (defined $ARGV[0] && $ARGV[0] =~ /^-/) {
# Debug
if ($ARGV[0] eq '-d') {
$debug = 1;
shift;
}
}
my $dskfile = shift or die "Must supply filename\n";
my $filename = shift or die "Must supply filename\n";
delete_file($dskfile, $filename, $debug);
1;

29
dos33lock.pl Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/perl -w
#
# dos33lock.pl:
#
# Utility to lock a file on an Apple II DOS 3.3 disk image.
#
# 20190116 LSH
#
use strict;
use DOS33;
while (defined $ARGV[0] && $ARGV[0] =~ /^-/) {
# Debug
if ($ARGV[0] eq '-d') {
$debug = 1;
shift;
}
}
my $dskfile = shift or die "Must supply filename\n";
my $filename = shift or die "Must supply filename\n";
lock_file($dskfile, $filename, $debug);
1;

29
dos33unlock.pl Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/perl -w
#
# dos33unlock.pl:
#
# Utility to unlock a file on an Apple II DOS 3.3 disk image.
#
# 20190116 LSH
#
use strict;
use DOS33;
while (defined $ARGV[0] && $ARGV[0] =~ /^-/) {
# Debug
if ($ARGV[0] eq '-d') {
$debug = 1;
shift;
}
}
my $dskfile = shift or die "Must supply filename\n";
my $filename = shift or die "Must supply filename\n";
unlock_file($dskfile, $filename, $debug);
1;