Re: [9fans] Binary File split

2010-05-10 Thread roger peppe
On 8 May 2010 18:35, Russ Cox wrote: > bs=1474560 > cat $file | for(i in `{seq 0 `{ls -l $file | awk '{print > int($6)/'$bs'}'}}) { dd -bs $bs -count 1 -of $file.$i } that looks very plausible, but it doesn't actually work, as awk doesn't coelesce short reads (it gets short reads from the pipe)

Re: [9fans] Binary File split

2010-05-10 Thread Arvindh Rajesh Tamilmani
i had a similar need some time back and used inferno's sh: http://a-30.net/inferno/dis/split arvindh

Re: [9fans] Binary File split

2010-05-10 Thread Tharaneedharan Vilwanathan
hi, since i see many solutions, i thought i will add mine too (if you can use inferno). attached please see the limbo program i wrote for this. it has helped me many times: didnt have to come out with parameters for dd commands which i used to use before for this kind of tasks. please note that t

Re: [9fans] Binary File split

2010-05-10 Thread erik quanstrom
> but there's still a little annoyance - if the file size is an exact > multiple of the block size, it will generate an unnecessary zero-length > file at the end. sometimes what should work, doesn't. that (and the whitespace) are why my version is longer. > i tried to fix it to get rid of this,

Re: [9fans] Binary File split

2010-05-10 Thread roger peppe
On 10 May 2010 12:40, erik quanstrom wrote: > this isn't awk's fault.  awk gets the right result.  you've illustrated > the dismalness of seq. good point. i should have worked that out! it's not the first time i've been caught out by %g - perhaps the default precision of %g should be 12 or more.

Re: [9fans] Binary File split

2010-05-10 Thread gas
Isn't the sensible solution to add a "-b bytes" option to split?

Re: [9fans] Binary File split

2010-05-10 Thread Iruata Souza
On Mon, May 10, 2010 at 11:01 AM, gas wrote: > Isn't the sensible solution to add a "-b bytes" option to split? > split -b Considered Harmful.

Re: [9fans] Binary File split

2010-05-10 Thread Ethan Grammatikidis
On 10 May 2010, at 15:52, Iruata Souza wrote: On Mon, May 10, 2010 at 11:01 AM, gas wrote: Isn't the sensible solution to add a "-b bytes" option to split? split -b Considered Harmful. Just curious having not heard of split before, what's the purpose of it as-is? :) -- Simplicity doe

Re: [9fans] Binary File split

2010-05-10 Thread erik quanstrom
> Just curious having not heard of split before, what's the purpose of > it as-is? :) split(1) is pretty informative. in Þe auncien[t] dais, it was sometimes hard to send big files by email or fit them on floppies or 9 track tapes. rchistory(1) shows i haven't used it once in the last 5 years.

Re: [9fans] Binary File split

2010-05-10 Thread Ethan Grammatikidis
On 10 May 2010, at 16:39, erik quanstrom wrote: Just curious having not heard of split before, what's the purpose of it as-is? :) split(1) is pretty informative. in Þe auncien[t] dais, it was sometimes hard to send big files by email or fit them on floppies or 9 track tapes. rchistory(1)

Re: [9fans] 9atom hw support

2010-05-10 Thread erik quanstrom
On Mon May 10 12:17:49 EDT 2010, m...@endeavour.zapto.org wrote: > Are the canonical sources to 9atom online/web-viewable someplace? > not currently. i'm working on that. - erik

Re: [9fans] 9atom hw support

2010-05-10 Thread Venkatesh Srinivas
Are the canonical sources to 9atom online/web-viewable someplace? -- vs

Re: [9fans] Binary File split

2010-05-10 Thread Skip Tavakkolian
# usage: sledge /tmp/foo /tmp/bar 31415 # could also be named crowbar fn sledge () { ifile=$1 ofile=$2 size=$3 if (~ $#* 3) { for (i in `{seq 0 `{ls -l $ifile | awk '{print int($6/'^$size^')}'}}) { echo dd -if $ifile -of $ofi

Re: [9fans] Binary File split

2010-05-10 Thread Derek Thomas
> > split -b Considered Harmful. > > Just curious having not heard of split before, what's the purpose of > it as-is? :) Do you mean what's it's use? I'm no unix (or Plan 9) elder, but I think it's a file-based implementation of what some text editors call folding. Not a trivial function. Be