[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: avoid spurious failures from MacOS readdir bug
From: |
Eric Blake |
Subject: |
Re: avoid spurious failures from MacOS readdir bug |
Date: |
Sat, 06 Dec 2008 07:41:49 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.18) Gecko/20081105 Thunderbird/2.0.0.18 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Paolo Bonzini on 12/5/2008 11:35 PM:
> Indeed, they shouldn't have problems because their line length limit is
> ~4000 (giving a maximum length of ~2000 bytes for files in the
> directory, which is safe). However, note that the script is emulating
> uniq, not sort -u. I don't know if this is safe?
ls already sorts its output. In 2.63, we had a no-op sort process:
ls | sed | sort
(technically, there are instances where sorting after sed is still
necessary, but for this particular sed script, all we are doing is
deleting lines). Then I changed it to work around the MacOS issue:
ls | sed | sort -u
at which point, the only thing sort is adding is uniqueness:
ls | sed | uniq
or with fewer processes:
ls | sed
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkk6jywACgkQ84KuGfSFAYAwwwCfa436fEUyA5CuZCCoWq9uKvcx
y9EAnjydONlRO2O0Dsb4mXD9cYg2osJz
=MVqs
-----END PGP SIGNATURE-----