split and cat

Cook, John John.Cook@kla-tencor.com
Thu Jan 29 17:11:00 GMT 1998


> >On 23 Jan 98 at 22:31,  malcolm <malcolm@eml.co.uk> wrote:
> >> Are split and cat supposed to work properly as a means of splitting
> >> large binary files and joinging the pieces back together. I find
> that
> >> split craps out having performed a good job of creating nothing
> useful.
> >> If I use split on a Linux box and then try to use cat to put the
> bits
> >> back together, that fails as well. Typical files I have tried are
> 10+MB
> >> being split into 1MB chunks.
> >> 
> >> Just curious to hear if anyone has got them to work - in which case
> its
> >> my setup. Or if its a common problem, is a fix on the way?
>  
> On 28-Jan-1998, hgfernan@usp.br <hgfernan@usp.br> wrote:
> > congratulations: like everybody else you've been bitten by the
> > binary/non-binary file dichotomy in gnu-win32. :-)
> 
Then Fergus wrote:
>Homework exercise: patch `split' so that it opens its files in binary
mode.
>
>(`cat' is a bit more troublesome, but adding a `--binary' option should
>not be too hard.)

DJGPP's cat defaults to binary for all files and 'text mode' for console

output, but provides a 'binary' option specific to console output;
consult 
their sources to make your homework easier:

  F:\djgpp\bin>cat --help
  Usage: f:/djgpp/bin/cat.exe [OPTION] [FILE]...
  Concatenate FILE(s), or standard input, to standard output.

    -A, --show-all           equivalent to -vET
    -b, --number-nonblank    number nonblank output lines
    -e                       equivalent to -vE
    -E, --show-ends          display $ at end of each line
    -n, --number             number all output lines
    -s, --squeeze-blank      never more than one single blank line
    -t                       equivalent to -vT
    -T, --show-tabs          display TAB characters as ^I
    -u                       (ignored)
    -v, --show-nonprinting   use ^ and M- notation, except for LFD and
TAB
        --help               display this help and exit
        --version            output version information and exit

  With no FILE, or when FILE is -, read standard input.

    -B, --binary             use binary writes to the console device.

--John
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list