Wanted: archiver, zip/tar equivalent

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
hjalfi
Posts: 74
Joined: Sat May 13, 2017 10:17 pm
Location: Zürich, Switzelrand
Contact:

Wanted: archiver, zip/tar equivalent

Postby hjalfi » Mon Sep 25, 2017 3:58 pm

Does anyone know of a tool for the MOS which archives/dearchives multiple files to/from a single file? Like zip -0 or tar; compression optional. I particularly need support for the MOS execution and load addresses, and hierarchical file system support.

I'm sure such a thing must exist from the dialup days --- somewhere. Where?

For bonus points: if the tool has a portable C implementation so I can generate archives from Linux, that'd be even better...

User avatar
Rich Talbot-Watkins
Posts: 1108
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: Wanted: archiver, zip/tar equivalent

Postby Rich Talbot-Watkins » Mon Sep 25, 2017 4:05 pm

Anything here which does the job?
http://mdfs.net/Apps/Archivers/

User avatar
jgharston
Posts: 2728
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: Wanted: archiver, zip/tar equivalent

Postby jgharston » Mon Sep 25, 2017 8:06 pm

BBCZip

Uses the same command line parameters as InfoZip (source at link).

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
hjalfi
Posts: 74
Joined: Sat May 13, 2017 10:17 pm
Location: Zürich, Switzelrand
Contact:

Re: Wanted: archiver, zip/tar equivalent

Postby hjalfi » Mon Sep 25, 2017 10:07 pm

BBCZip doesn't seem to like hierarchical file systems, but it looks like Archiver works fine --- thanks. (Although I haven't found a way for it to extract to another other than the CWD yet.)

Also, ADFS is really, really slow when dealing with directories. I don't know why it keeps bouncing the head back to track zero and back --- it doesn't seem to be doing anything there, from the emulated noises b-em is making, but it sure likes to do it a lot. Is HADFS better with this? I'm more or less exclusively working on a second processor so PAGE changes don't bother me.

User avatar
hjalfi
Posts: 74
Joined: Sat May 13, 2017 10:17 pm
Location: Zürich, Switzelrand
Contact:

Re: Wanted: archiver, zip/tar equivalent

Postby hjalfi » Thu Sep 28, 2017 6:41 am

(Turns out I'm doing ADFS an injustice. b-em's disk drive sounds are very, very approximate, and any disk seek larger than a certain amount makes the seek-all-the-way-across-the-disk-to-track-zero-and-back-again sound; but also takes the same amount of time as seeking all the way across the disk etc. So in b-em with disk drive sounds enabled, you get much worse disk performance than on a real BBC. I believe Matt Godbolt's jsbeeb behaves the same way. Don't know about beebem yet.)

User avatar
jgharston
Posts: 2728
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: Wanted: archiver, zip/tar equivalent

Postby jgharston » Thu Sep 28, 2017 3:20 pm

hjalfi wrote:BBCZip doesn't seem to like hierarchical file systems, but it looks like Archiver works fine --- thanks. (Although I haven't found a way for it to extract to another other than the CWD yet.)

BBCZip is specifically written for hierarchial filing systems.

I've tweeked the BBCZip documentation and also converted the online manual pages to HTML: BBCZip/ManPages, and added the *man command to the archive.

Archiver will only fetch and extract to/from the current directory. It is an interactive program with limited options that prompts you through options.

BBCZip will fetch and extract to/from any directory. It is a command line tool with more options that you have to specify the actions when you run it. Use the -? option to get a summary of options. It is written to be as close to InfoZip in functionality as possible.

Simplest examples:
*zip outfile indir -r
or
CHAIN "zip outfile indir -r"
recursively archive up everything in indir putting it in outfile

*unzip infile -d outdir
or
CHAIN "unzip infile -d outdir"
extract everything in infile and store it in outdir

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
hjalfi
Posts: 74
Joined: Sat May 13, 2017 10:17 pm
Location: Zürich, Switzelrand
Contact:

Re: Wanted: archiver, zip/tar equivalent

Postby hjalfi » Thu Sep 28, 2017 4:06 pm

That's interesting. BBCZip expanded the files in the zip file root directory and then failed with (IIRC) a file not found equivalent error on the first file in a subdirectory. (Trying with BBCZip's own zipfile.) I was reading from VDFS and writing to ADFS, although I can't remember now whether the current filesystem was VDFS or ADFS; I've encountered a number of problems with using VDFS as a temporary filesystem.

Also I was completely unable to make the *RUN style invocation work --- instead I just loaded them and ran them. I now can't remember the symptoms. This was working on an emulated Master, both with and without Tube.

I'm currently away, but when I get back to my desk on Saturday I'll try and remember to have another go and produce a better bug report.

User avatar
jgharston
Posts: 2728
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: Wanted: archiver, zip/tar equivalent

Postby jgharston » Thu Sep 28, 2017 8:06 pm

hjalfi wrote:Also I was completely unable to make the *RUN style invocation work
Did you extract them with an UnZip tool that understands Acorn file metadata?

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
hjalfi
Posts: 74
Joined: Sat May 13, 2017 10:17 pm
Location: Zürich, Switzelrand
Contact:

Re: Wanted: archiver, zip/tar equivalent

Postby hjalfi » Fri Sep 29, 2017 6:19 am

Reasonably sure I did, but cocking that up is certainly the most likely explanation. I'll check.

User avatar
jgharston
Posts: 2728
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: Wanted: archiver, zip/tar equivalent

Postby jgharston » Fri Sep 29, 2017 1:41 pm

Once you've got UnZip extracted, just CHAIN it and then unzip the archive again. Archive, Zip and UnZip are all on my site as stand-alone programs so you can bootstrap yourself and extract the programs, otherwise you are left with the problem of opening the box with the spanner inside the box.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
hjalfi
Posts: 74
Joined: Sat May 13, 2017 10:17 pm
Location: Zürich, Switzelrand
Contact:

Re: Wanted: archiver, zip/tar equivalent

Postby hjalfi » Sat Sep 30, 2017 10:06 am

I can't duplicate the odd *RUN behaviour, so I must have broken the file attributes somehow --- never mind that, then.

But there are definitely some oddities with subdirectory handling: if Unzip is run with an empty destination path, then it's unable to create destination files in subdirectories, but is able to overwrite existing files; if it's run with $ as the destination path, it works fine.

>*ADFS
>*DIR
>*UNZIP BBCDIST/Z
Lib. Type 0 -
Lib.runtime/co Type 0 -
Not found
>*UNZIP BBCDIST/Z -d $
Lib. Type 0 -
Lib.runtime/co Type 0 - Extracting Done.
Finishing...Done.
>*UNZIP BBCDIST/Z
Lib. Type 0 -
Lib.runtime/co Type 0 - Extracting Done.
Finishing...Done.


This is on an emulated Master with Tube.

User avatar
jgharston
Posts: 2728
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: Wanted: archiver, zip/tar equivalent

Postby jgharston » Sat Sep 30, 2017 7:01 pm

hjalfi wrote:But there are definitely some oddities with subdirectory handling: if Unzip is run with an empty destination path, ...
>*ADFS
>*DIR
>*UNZIP BBCDIST/Z
Lib. Type 0 -
Lib.runtime/co Type 0 -
Not found
This is on an emulated Master with Tube.

Hmm. Odd. Try unzip bbcdist/z -d @
I don't remember ever encountering that myself, I'll do some testing.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
jgharston
Posts: 2728
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: Wanted: archiver, zip/tar equivalent

Postby jgharston » Sun Oct 01, 2017 12:05 am

It seems to be an(other) ADFS-ism:

Code: Select all

>*NET
>*.
TESTOUT   (020)     Owner
User                Option 02 (Run)
Dir. TESTOUT        Lib. Library

>*UNZIP :APPS.ARCHIVERS.BBCZIP/ZIP
UnZip Type 0 - Extracting Done.
Zip Type 0 - Extracting Done.
ZipCat Type 0 - Extracting Done.
ZipDiff Type 0 - Extracting Done.
ZipEx Type 0 - Extracting Done.
ZipInfo Type 0 - Extracting Done.
BBCZip/txt Type 0 - Extracting Done.
ManPages.U.1UnZip Type 0 - Extracting Done.
ManPages.Z.1Zip Type 0 - Extracting Done.
ManPages.Z.1ZipCat Type 0 - Extracting Done.
ManPages.Z.1ZipEx Type 0 - Extracting Done.
ManPages.Z.1ZipInfo Type 0 - Extracting Done.
ManPages.man Type 0 - Extracting Done.
suffix Type 0 - Extracting Done.
Finishing...Done.
>*.
TESTOUT   (029)     Owner
User                Option 02 (Run)
Dir. TESTOUT        Lib. Library

BBCZip/txt R/r      ManPages   D/       suffix     R/r      UnZip      R/r
Zip        R/r      ZipCat     R/r      ZipDiff    R/r      ZipEx      R/r
ZipInfo    R/r
>
>*ADFS
>*.
TESTFILES           (00)
Drive:0             Option 03 (Exec)
Dir. TESTFILES      Lib . Library

>*UNZIP -NET-:APPS.ARCHIVERS.BBCZIP/ZIP
UnZip Type 0 - Extracting Done.
Zip Type 0 - Extracting Done.
ZipCat Type 0 - Ext racting Done.
ZipDiff Type 0 - Extracting Done.
ZipEx Type 0 - Extracting Done.
ZipInfo Type 0 - Extracting Done.
BBCZip/txt Type 0 - Extracting Done.
ManPages.U.1UnZip Type 0 -
Not found
>P.ERL
      1220
>L.1220
1220DEFFNfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%DIV256:=(USR&FFDD)AND&FF
>P.$name%
ManPages.U.1UnZip
>

If you do OSFILE 1/2/3/4 on a non-existant object in a subdirectory, you correctly get 0 returned, but the next file access falls over:

Code: Select all

>*CDIR ManPages
>*CDIR ManPages.U
>PRINT FNfile("ManPages.U.1UnZip",4)
         0
>*.ManPages.U

Not found
>

Something similar happens on ADFS on RISC OS, and the work-around was to do OSFILE 5 first, so I've tweeked BBCUnZip so this work-around is used all the time.

Code: Select all

>*unzip -help
BBCUnZip v1.11 (C)J.G.Harston 1999-2015
Syntax: *UnZip infile -d path -q -X -Z -quit command
>*.
TESTFILES           (00)
Drive:0             Option 03 (Exec)
Dir. TESTFILES      Lib . Library

>*UNZIP -NET-:APPS.ARCHIVERS.BBCZIP/ZIP
UnZip Type 0 - Extracting Done.
Zip Type 0 - Extracting Done.
ZipCat Type 0 - Ext racting Done.
ZipDiff Type 0 - Extracting Done.
ZipEx Type 0 - Extracting Done.
ZipInfo Type 0 - Extracting Done.
BBCZip/txt Type 0 - Extracting Done.
ManPages.U.1UnZip Type 0 - Extracting Done.
ManPages.Z.1Zip Type 0 - Extracting Done.
ManPages.Z.1ZipCat Type 0 - Extracting Done.
ManPages.Z.1ZipEx Type 0 - Extracting Done.
ManPages.Z.1ZipInfo Type 0 - Extracting Done.
ManPages.man Type 0 - Extracting Done.
suffix Type 0 - Extracting Done.
Finishing...Done.
>

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_


Return to “software: other”

Who is online

Users browsing this forum: No registered users and 2 guests