This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: How do I split binaries to manageable chunks


Looks to me like split -b or split -c should do a binary split and otherwise
it should do a text-mode split.  I think this is a good example of how hard
it is to always "do the right thing" in binary mode vs text mode land.
That's why I use binary mounts and hand convert (unix2dos or dos2unix) files
to the right mode as needed.

-- John

> -----Original Message-----
> From: Joshua Rosen [mailto:rozzin@geekspace.com]
> Sent: Tuesday, June 22, 1999 7:38 PM
> To: cygwin@sourceware.cygnus.com
> Subject: Re: How do I split binaries to manageable chunks
> 
> 
> Earnie Boyd wrote:
> 
> > --- itz@lbin.com wrote:
> > -8<-
> > > Well, this looks exactly like the situation that shows 
> the ultimate
> > > futility of trying to accomodate MSDOG text files.  How 
> is split to
> > > know what type of file it is handling?  Should we embed a copy of
> > > file(1) into split?  Stoop down to MSDOG practice and rely on file
> > > names?  Or what?
> >
> > The utility split should just always process in binary mode.
> 
>     Given that the `split' utility is meant to split text 
> files, it should
> definitely -not- -always- process in binary mode, if only 
> because splitting a
> multibyte newline character down the middle, putting part of 
> the `single
> character' at the end of one file, and the rest of the 
> character at the
> beginning of another file, is probaly not the best of ideas....
>     Though, in response to Ian's comments: it might be nice 
> to have to option
> of splitting in binary mode, but embedding a version of 
> file(1) into split(1)
> really isn't necessary to do that--all that'd be needed is a 
> command-line flag
> to run split in binary mode.
>     Again, UUEncoding the binary file and then splitting it 
> is an option, too,
> but probably not the most desirable, because it adds two 
> steps, every time you
> want to go through this procedure, and it gives you a larger 
> file to split.
>     As Phil said, one could use dd, but that's sort of 
> cumbersome, so one could
> write up a shell script to simplify things, but it probably 
> would be easier to
> just code a binary version of split, or, as has already been 
> suggested, change
> the mode in the existing version and call it `bsplit' or something.
> 
>     Dit I miss anything?
>                 -Rozzin.
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]