[MLton] Slow commits to MLton's SVN repository

Henry Cejtin henry.cejtin at sbcglobal.net
Fri Jan 12 08:28:13 PST 2007


I'm  a bit confused what your script is actually supposed to do.  If the size
of the result of the look is 2^16 or more, it writes the first 2^16 bytes  to
stdout, else it writes all of it.

For  one  thing, I don't get the reason for the second dd.  If you don't read
in all the output of cat it shouldn't matter.

Second, the sequence
    cat file | command
can always be replaced by
    command <file

Third, if the file is small, then the first dd still would not fail.

Hence it looks to me like the whole thing is equivalent to
    dd ibs=1 count=65536 2>/dev/null
which also has the added advantage of not introducing any  security  or  race
condition problems with the fixed file name /tmp/z.svn-diff.

Actually, I would dump dd and use head for this:
    head -c 65536



More information about the MLton mailing list