On 13/05/11 13:06, Jim Meyering wrote: > Very nice. Thank you! > That appears to work fine on Linux/glibc, > but fails on a solaris 10 system which lacks ctypes: > > and fails on solaris 5.11 and freebsd 8.x due to the absence of libc.so.6 > (one of those has libc.so and libc.so.1):
Yep, you'll need this around the whole script: try: # the script except: sys.exit(1) If we were paranoid about segfaults which I've seen happen with ctypes, one might wrap the script in (unlimit -c 0; ) > requiring that "." be the first entry > should be enough for nearly all uses. > > sys.exit(ep.contents.d_name != "." or ep.contents.d_type != DT_DIR) Yep that should give enough test coverage, and we can just comment in the script for cases where it fails. cheers, Pádraig.
