I want a filter that reads file names on stdin and writes the zipped files
to stdout on the fly:
Pseudocode:
write zip header on stdout
while not EOF(stdin) {
read a single line from stdin containing the file name;
write zipped version of file to stdout
}
write zip trailer to stdout
Zip 2.3 in www.info-zip.org appears to allow reading file names
from stdin, or writing to stdout, but not both:
cat filelist|zip -r - -@>file.out
zip error: Invalid command arguments (can't use - and -@ together)
Is there another zip implementation that does what I want??
gtoomey
|
|
0
|
|
|
|
Reply
|
nospam258 (216)
|
8/3/2003 10:57:57 AM |
|
In comp.os.linux.misc Gregory Toomey <NOSPAM@bigpond.com> wrote:
> Zip 2.3 in www.info-zip.org appears to allow reading file names
> from stdin, or writing to stdout, but not both:
> cat filelist|zip -r - -@>file.out
That's because ...
> zip error: Invalid command arguments (can't use - and -@ together)
You want
cat filelist | xargs zip -r - > file.out
Peter
|
|
0
|
|
|
|
Reply
|
ptb (2756)
|
8/3/2003 11:20:11 AM
|
|
Gregory Toomey <NOSPAM@bigpond.com> wrote:
> I want a filter that reads file names on stdin and writes the zipped files
> to stdout on the fly:
> Pseudocode:
> write zip header on stdout
> while not EOF(stdin) {
> read a single line from stdin containing the file name;
> write zipped version of file to stdout
> }
> write zip trailer to stdout
Mmmh, something like this?
$ for i in *;do zip $i.zip $i;done
--
Michael Heiming
Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM
|
|
0
|
|
|
|
Reply
|
USENET22 (5462)
|
8/3/2003 11:22:08 AM
|
|
Gregory Toomey wrote:
> I want a filter that reads file names on stdin and writes the zipped files
> to stdout on the fly:
>
> Pseudocode:
> write zip header on stdout
> while not EOF(stdin) {
> read a single line from stdin containing the file name;
> write zipped version of file to stdout
> }
> write zip trailer to stdout
>
>
> Zip 2.3 in www.info-zip.org appears to allow reading file names
> from stdin, or writing to stdout, but not both:
> cat filelist|zip -r - -@>file.out
> zip error: Invalid command arguments (can't use - and -@ together)
>
> Is there another zip implementation that does what I want??
zip - `cat filelist`
|
|
0
|
|
|
|
Reply
|
me4 (18697)
|
8/3/2003 11:37:23 AM
|
|
"Michael Heiming" <michael+USENET@www.heiming.de> wrote in message
news:09rigb.0hd.ln@news.heiming.de...
> Gregory Toomey <NOSPAM@bigpond.com> wrote:
> > I want a filter that reads file names on stdin and writes the zipped
files
> > to stdout on the fly:
>
> > Pseudocode:
> > write zip header on stdout
> > while not EOF(stdin) {
> > read a single line from stdin containing the file name;
> > write zipped version of file to stdout
> > }
> > write zip trailer to stdout
>
> Mmmh, something like this?
>
> $ for i in *;do zip $i.zip $i;done
This produces lots of zip archvies; I want only one.
gtoomey
|
|
0
|
|
|
|
Reply
|
nospam258 (216)
|
8/3/2003 11:41:56 AM
|
|
In comp.os.linux.misc Gregory Toomey <NOSPAM@bigpond.com> wrote:
> "Peter T. Breuer" <ptb@oboe.it.uc3m.es> wrote in message
> news:nuqigb.f19.ln@news.it.uc3m.es...
>> In comp.os.linux.misc Gregory Toomey <NOSPAM@bigpond.com> wrote:
>> > cat filelist|zip -r - -@>file.out
>>
>> > zip error: Invalid command arguments (can't use - and -@ together)
>>
>> You want
>>
>> cat filelist | xargs zip -r - > file.out
> I simplified things too much. There is a Perl program that generates the
> file names, about one every 10 seconds.
> perlprog.sh|zip -r - -@>file.out
> xargs only runs commands when there is EOF on stdin (this is a
You are expressiing the difference between strict and lazy evaluation.
xargs must be strict because it cannot pass a partial command line to
the process it executes.
> simplification). I want a partial zip file written after each file name is
> generated.
Where does the list of names that zip puts in the archive go? If it's
at the end, you're OK. If at the beginning, you're dead.
zip isn't meant to be a streaming archiver. use cpio or apio or tar.
Peter
|
|
0
|
|
|
|
Reply
|
ptb (2756)
|
8/3/2003 12:20:11 PM
|
|
Gregory Toomey <NOSPAM@bigpond.com> wrote:
> "Michael Heiming" <michael+USENET@www.heiming.de> wrote in message
....
>> Mmmh, something like this?
>>
>> $ for i in *;do zip $i.zip $i;done
> This produces lots of zip archvies; I want only one.
From your pseudo code, I assumed you wanted multiple
files.
$ ls | zip all.zip -@
--
Michael Heiming
Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM
|
|
0
|
|
|
|
Reply
|
USENET22 (5462)
|
8/3/2003 12:50:01 PM
|
|
After confusing everyone (including me), I discovered a perl module
Archive::Zip
www.search.cpan.org/author/NEDKONZ/Archive-Zip-1.06/lib/Archive/Zip/FAQ.pod
and in it there is a "MockFileHandle" example
"examples/mfh.pl -- demo for use of MockFileHandle"
which can be adapted to do what I want.
gtoomey
|
|
0
|
|
|
|
Reply
|
nospam258 (216)
|
8/4/2003 12:58:49 PM
|
|
Url should be http://tinyurl.com/iyhn
GT
|
|
0
|
|
|
|
Reply
|
nospam258 (216)
|
8/4/2003 1:09:25 PM
|
|
|
8 Replies
195 Views
(page loaded in 0.267 seconds)
Similiar Articles: Help: How to recover EoCD signature not found err? Many Thanks ...Dear all, I have a very large zip file in VMS Alpha in 1135302 blocks damaged. ... Can I have an on-the-fly encrypted disk on Solaris 10? TrueCrypt says it has a ... tar terminates unexpectedly when piped to dd ? - comp.os.linux ...The $PIPE1 is a file created with mkfifo - very useful to do a checksum on-the-fly. ... mind the part about checksum mismatch - the backup *is* fine, I was just cat'ing the ... VHF Comm - comp.dspPreliminary discussions with the pilots has revealed the follow= ing >> additional ... the= >> problem seems to be worse with the second >> helicopter having to fly to ... Faster way to unzip patches? - comp.unix.solarisThere must be a faster way of doing this. >> >> unzip 9_Recommended.zip >> >> Add a ... There must be a faster way of doing this. > Thanks > Angela You mean more-ing thru ... How to convert file (txt) to pdf on IBM aix 5 - comp.text.pdf ...... Server and Block plugin _____PDFlib - a library for generating PDF on the fly_____ ... spool, text, textual report to nice pdf (form, invoice, report, sale ... Windows (ZIP ... where is the mym.m? How to use it? Thanks. - comp.soft-sys.matlab ...I downloaded the mym package, mym_src_v1.36.zip (29.8 KB), from http://sourceforge ... Den Lianer Goist ... memory on-the-fly, based on filesize, so I have tried to > use ... Symantec NetBackup 7.1 release update - comp.os.vmsOpenVMS client release updates are zip archives which can be unzipped on OpenVMS ... Define the NBU symbol as a foreign command (include the lead- ing $ character ... How to EXPLODE using freeware libs - comp.compression"Ing. Marco Lo Monaco" <mr.alien@libero.it> wrote in message news:<bm1cbg$d66$1@grillo ... gz If on the other hand, it is PKZip's implode method, then look at Info-ZIP's zip ... Calculated Find - comp.databases.filemakerOne of the solutions I have built does something similar, but by zip code and within ... is based on a longitude range and a latitude range that is > calculated on the fly ... File Cannot be Compressed - comp.compressionHello, I'm having a weird issue. I have a huge Outlook pst (6GB) file that i want to compress. I have tried WinRAR, WinZip, 7-Zip, WinAce and all of ... On The FlyOnline mens store, gifts for him by well known brands for Men's clothing and grooming. Online Mens gifts store by On The Fly, the friendly Gifts For Him store. Online Banking - ING DIRECT USA - Save Your Money!®An FDIC insured national bank offering one of the highest savings rates with no fees and no minimums. ING DIRECT also provides highly competitive checking account ... 7/28/2012 12:13:21 PM
|