waling a directory with very many files

Nick Craig-Wood nick at craig-wood.com
Mon Jun 15 10:29:33 EDT 2009


Hrvoje Niksic <hniksic at xemacs.org> wrote:
>  Nick Craig-Wood <nick at craig-wood.com> writes:
> 
> > Here is a ctypes generator listdir for unix-like OSes.
> 
>  ctypes code scares me with its duplication of the contents of system
>  headers.  I understand its use as a proof of concept, or for hacks one
>  needs right now, but can anyone seriously propose using this kind of
>  code in a Python program?  For example, this seems much more
>  "Linux-only", or possibly even "32-bit-Linux-only", than
>  "unix-like":

It was a proof of concept certainly..

It can be done properly with gccxml though which converts structures
into ctypes definitions.

That said the dirent struct is specified by POSIX so if you get the
correct types for all the individual members then it should be correct
everywhere.  Maybe ;-)


-- 
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick



More information about the Python-list mailing list