Mass File Depression Maintaining Directory Structure

Rasmussen, Lloyd lras at
Tue Jan 11 17:01:35 UTC 2011

A book or magazine from the National Library Service is a simple zip file which does not have any directories within it.  You could say that all of the files are at the root level within the zip container.  This is unlike ODT, Epub or Docx, which are much more complicated zip structures.

As long as the filenames are unchanged and the contents of one book remain within a given directory, the name of that directory does not matter to the NLS digital talking book player unless that directory is named "audio+podcasts", in which case the collection will be treated as audio files instead of a book.

Lloyd Rasmussen, Senior Project Engineer
National Library Service for the Blind and Physically Handicapped
Library of Congress   202-707-0535
The preceding opinions are my own and do not necessarily reflect those of the Library of Congress, NLS.

-----Original Message-----
From: blinux-list-bounces at [mailto:blinux-list-bounces at] On Behalf Of Tim Chase
Sent: Tuesday, January 11, 2011 10:49 AM
To: Rasmussen, Lloyd; Linux for blind general discussion
Subject: Re: Mass File Depression Maintaining Directory Structure

> After reading "man zip", I am still not able to uncompress a load of 
> NLS books in the specific way required for the task I am working on.

I'm not familiar with the NLS zip structure which makes it hard to determine what you are trying to do.  The good news is that there's almost positively a straight-forward way to do what you want...I just need to understand what that is ::smile::

> I just want to uncompress the directory so it can be accessed by a 
> DB-player's software.

There are a couple possibilities:

1) an NLS file is a zip-file containing a bunch of files that are in subdirectories within the zip-file.

In this case, you may want to do any of the following:

1a) extract just the directory structure without extracting the files

1b) extract the files into a flat structure without the hierarchy stored in the zip file, or

1c) most likely (based on what I *think* you're describing) there are multiple directories stored in the zip-file and you'd like to extract just one of them.  To do this, you can specify which files to extract on the command-line (assuming the zip-file contains a subdirectory structure of "contained_folder/subfolder/" with the things inside that you want):

   unzip contained_folder/subfolder/*

which will only extract the files given on the command-line, not
*all* the files in the zip-file.

2) an NLS file is a zip-file containing a bunch of files that have no hierarchy and you would like to put them in a subdirctory when you uncompress them so that they don't litter your current working-directory with the files.

> unzip -d /home/riverwind/holder
> The file decompressed right enough, but there was no directory.
> Instead the actual files were decompressed.

This is what I would expect from this command and it addresses #2 above.  Your command says "unzip the contents of and put any contained files/directories/hierarchy in /home/riverwind/holder (creating that folder if needed)".

It might help to include a portion of the output of

   unzip -t

You can pipe that into a file to copy/paste/attach if you want

   unzip -t > file01_contents.txt

That way we can get a clearer understanding of the structure inside the zip-file and craft a better solution.


Blinux-list mailing list
Blinux-list at

More information about the Blinux-list mailing list