[softwarelist] Re: Spark Reads File SparkFS Can't Open

  • From: David Pilling <flist@xxxxxxxxxxxxxxxxxxx>
  • To: davidpilling@xxxxxxxxxxxxx
  • Date: Mon, 4 Mar 2013 12:13:30 +0000

Hi,

In message <2135475674.1382591.1362397056708.JavaMail.open-xchange@xxxxxxxxxxxxxxxxx
to.de>, Steffen Huber <steffen@xxxxxxxxxxxx> writes
Mik Towse <mik.towse@xxxxxxxxx> write:
Looking at the files in Zap suggests that the file list at the end of the
ZIP are missing.
Look at the commands (or was it a system variable?) that belong to the SparkFS
ZIP module. One is called "UseCentralDirectory" or something like that. Turn it

All this is right. The central directory (list of contained files) is tacked on the end of a zip file, but filenames are repeated with the individual files throughout the zip, so one has two ways of reading the zip. Using the central dir is faster and hence the default, but there is a *command that lets you switch, and the old Spark program does not use the central dir.

How can you lose the central directory - the easiest way is moving a file or powering the computer off before the central directory has been written. If you look in the ReadMe you will find that there is a configurable time delay after which SparkFS writes the central dir.

I've explained this many times, adding a string of files to an archive and writing the central dir after each file is added is slow - people used to complain, "why is info zip so much faster". This problem comes with being a file system and not a command line tool. RISC OS does not say "Hey file system baby we're going to add 20 files. Yow!", it merely opens and closes individual files.

The solution is to have a time delay where the archive stays open until it can assume no more changes are going to take place.

In any file transfer process, if things go wrong the most common consequence is that the end of the file gets chopped off (the file is truncated). Again you lose the central directory.

20 years on, it would be a good idea if the central dir is not found the zip module had another go with the distributed headers.


--
David Pilling
email: david@xxxxxxxxxxxxxxxxxxx
  web: http://www.davidpilling.net

To unsubscribe or subscribe goto: //www.freelists.org/list/davidpilling

Other related posts: