diff --git a/DOS33.pm b/DOS33.pm index 065a3f0..9f1ab20 100644 --- a/DOS33.pm +++ b/DOS33.pm @@ -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; diff --git a/README b/README index 0308c1d..f42f3ee 100644 --- a/README +++ b/README @@ -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 diff --git a/dos33delete.pl b/dos33delete.pl new file mode 100644 index 0000000..60a3e3c --- /dev/null +++ b/dos33delete.pl @@ -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; + diff --git a/dos33lock.pl b/dos33lock.pl new file mode 100644 index 0000000..385677c --- /dev/null +++ b/dos33lock.pl @@ -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; + diff --git a/dos33unlock.pl b/dos33unlock.pl new file mode 100644 index 0000000..8121818 --- /dev/null +++ b/dos33unlock.pl @@ -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; +