----- Original Message ----- 
From: "Matt Benson" <[EMAIL PROTECTED]>
To: "Ant Users List" <user@ant.apache.org>
Sent: Tuesday, October 18, 2005 2:16 PM
Subject: Re: Size of zip file


> --- Rhino <[EMAIL PROTECTED]> wrote:
>
> > Oops, I missed that when I looked in the manual!
> >
> > Even still, I don't think Ant has the ability to
> > decide which files from the
> > original zip are to be grouped together into the new
> > smaller zips.
>
> <length> should work even if you pass in <zipfileset>s
> and therefore give you the lengths of all the
> constituent resources... but at that point you'd
> probably be just as well writing something to process
> the resources directly using Ant or Java APIs rather
> than parsing the output of <length mode="each" />.
>
Even if Ant's <length> task tells you the size of the zip file and of each
of its constituent files, I think you still need some kind of programming
logic to decide which of the new smaller zip files is going to get each of
the files that were in the original zip. (I'm assuming that the individual
files within the zip are never themselves going to be split up.) There has
to be some logic that isn't - as far as I can tell! - in Ant to reason out
that, for example, the optimum dispersal of the files in zip containing 5
files is to put the 1st, 2nd and 5th files into the first of the new zip
files and that the 3rd and 4th files into the second new zip file - or
whatever. That logic will be based on user input that says the size of the
new zips should not exceed so many bytes. The logic will have to determine
the size of the individual files within the zip and then group them together
so that none of the new zips is over that maximum size. It will also have to
handle the case where the user asks for a size that is smaller than the
largest of the files in the zip file: if the maximum size is 5 MB and two of
the files in the zip file are 20 MB in size, what is the utility to do?

> > (I'm
> > assuming that a large zip containing many files
> > needs to be split into
> > smaller zips that are less than or equal to a given
> > size and that as few
> > smaller zips should be created as possible.)
> >
>
> I had taken the request literally; that the archive
> should be broken into smaller files that would be
> reassembled later into the original archive... nothing
> to that.  But each split file would be unusable on its
> own.  I believe the tool that used to do something
> like this, and was mentioned by another user, was RAR
> (I could be wrong though).
>
Your guess is as good as mine; I don't know if the questioner would find it
permissible to split the individual files within the zip or not. But I think
we've covered both cases now :-)

After sending my first reply, I Googled on "file splitter" and came up with
over a million hits! Even adding the word "java" to the search returned an
awful lot of hits. So I'm pretty sure that it won't be necessary to write a
new utility unless, perhaps, the user requires that each of the original
files must never be split and that the output files are zip files
themselves. Then again, maybe RAR or some other utility will handle that
case too.

Rhino
>
> >
> > ----- Original Message ----- 
> > From: "Matt Benson" <[EMAIL PROTECTED]>
> > To: "Ant Users List" <user@ant.apache.org>
> > Sent: Tuesday, October 18, 2005 11:19 AM
> > Subject: Re: Size of zip file
> >
> >
> > > Ant >= 1.6.3 includes the <length> task which can
> > get
> > > file sizes for you.  You could probably (a) write
> > > something or (b) find something to do the split
> > for
> > > you.
> > >
> > > -Matt
> > >
> > > --- [EMAIL PROTECTED] wrote:
> > >
> > > >
> > > > Dear All,
> > > >           I would like to know that if is
> > possible
> > > > that I can take a
> > > > size of zip file, is there any such task in ANT
> > by
> > > > using which I can
> > > > know the size of a zip file or folder.
> > > > And also want to know that is I can split any
> > zip
> > > > file into desirable
> > > > equal size?
> > > > Any help will be highly appreciated.
> > > >
> > > > Regards,
> > > > Pritesh
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Confidentiality Notice
> > > >
> > > > The information contained in this electronic
> > message
> > > > and any attachments to this message are intended
> > > > for the exclusive use of the addressee(s) and
> > may
> > > > contain confidential or privileged information.
> > If
> > > > you are not the intended recipient, please
> > notify
> > > > the sender at Wipro or [EMAIL PROTECTED]
> > > > immediately
> > > > and destroy all copies of this message and any
> > > > attachments.
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Yahoo! Music Unlimited
> > > Access over 1 million songs. Try it free.
> > > http://music.yahoo.com/unlimited/
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> > > -- 
> > > No virus found in this incoming message.
> > > Checked by AVG Anti-Virus.
> > > Version: 7.0.344 / Virus Database: 267.12.0/134 -
> > Release Date: 14/10/2005
> > >
> > >
> >
> >
> >
> > -- 
> > No virus found in this outgoing message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.344 / Virus Database: 267.12.0/134 -
> > Release Date: 14/10/2005
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.12.0/134 - Release Date: 14/10/2005
>
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.0/134 - Release Date: 14/10/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to