walking a directory with very many files

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Wed Jun 17 01:45:23 EDT 2009


In message <mailman.1588.1245076727.8015.python-list at python.org>, Jean-Paul 
Calderone wrote:

> The problem is that POSIX specifies the fields with types like off_t and
> ino_t.  Since ctypes doesn't know anything about these types, application
> code has to specify their size and other attributes.  As these vary from
> platform to platform, you can't get it correct without asking a real C
> compiler.

Just to add to the complications, on 32-bit platforms, off_t can be either 
64 bits or 32 bits, depending on whether a C program is compiled with
-D_FILE_OFFSET_BITS=64 or not. This causes all kinds of aliasing of POSIX 
routines to the appropriate variants of the underlying libc routine names.

With ctypes, you have to directly access the underlying routine names, 
unless you implement some kind of equivalent aliasing scheme on top.




More information about the Python-list mailing list