Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18800

Ctypes compatibility

Date 2012-01-10 21:20 -0600
From Evan Driscoll <edriscoll@wisc.edu>
Subject Ctypes compatibility
Newsgroups comp.lang.python
Message-ID <mailman.4624.1326252057.27778.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Ctypes compatibility Evan Driscoll <edriscoll@wisc.edu> - 2012-01-10 21:20 -0600

csiph-web