Ctypes compatibility

E

Evan Driscoll

Might as well ask another question of the list.

I've written a ctypes-based Python wrapper around the 'readdir'
function. (I want access to the dt_type field of the result, without
calling stat().)

However, it feels very... fragile. What happens on a different *nix
which uses a different size of integers? Is Linux even consistent
between 32 and 64 bits? (That's a rhetorical question.) What happens on
a different *nix with the fields in a different order, or without a
dt_type field?

It somehow feels wrong that you get way less help with this than you
would get even from C. Is that just how it is with ctypes? Or is there
some way around it? I'm sort of tempted to write a C module whose sole
purpose is to wrap readdir...

Evan



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPDP//AAoJEAOzoR8eZTzgzOYH/R8jOzxnXdau8a+/m9w1OqNP
RivArMvMvJgyLyWApfR2POkOlw8Gk9AE7Z39sOZeEt5QoLzdDXDXobNM+lore0e8
s53hth/uyH3VRUsUQJNkKBEfzpEzAiDz+ofM5es6BK5TsVYJ00so2oz3tCQS0pJf
dm9rCMGv/++OvxpuJuoRkEAJAwkeNXu4lV7R41KirJTmd9LtV9dTvuE+/RJ6YI72
TLguDjLpH0Pg0PWXXKffJbDYCUWmpSknbKrEqLhgb8pzjNthFQgylctcA8B/lyOw
q9S+Ii1/XxGfIInjT2cRue738wy7XbXWagIF0SUH+cBxar8K6pO66S6Syim/YMk=
=wbs/
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top