Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!amsnews11.chello.com!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'wrapper': 0.07; 'python': 0.08; 'content-type:multipart/signed': 0.09; 'filename:fname piece:signature': 0.09; 'result,': 0.15; '*nix': 0.16; 'content- type:application/pgp-signature': 0.16; 'field?': 0.16; 'filename:fname piece:asc': 0.16; 'filename:fname:signature.asc': 0.16; 'tempted': 0.16; 'linux': 0.17; 'wrap': 0.18; 'written': 0.20; 'somehow': 0.23; 'module': 0.26; "i'm": 0.26; "i've": 0.31; 'sort': 0.33; 'header:User-Agent:1': 0.33; 'there': 0.33; 'it?': 0.33; 'to:addr:python-list': 0.34; 'calling': 0.34; 'function.': 0.34; 'list.': 0.35; 'however,': 0.36; 'question': 0.36; 'uses': 0.36; 'received:192': 0.37; 'another': 0.37; 'received:128': 0.37; 'some': 0.38; 'received:192.168.0': 0.38; 'help': 0.39; 'to:addr:python.org': 0.40; 'might': 0.40; 'received:192.168': 0.40; 'happens': 0.40; 'order,': 0.73 Date: Tue, 10 Jan 2012 21:20:31 -0600 From: Evan Driscoll User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: python-list@python.org Subject: Ctypes compatibility X-Enigmail-Version: 1.3.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig51662C75BEA9015F07F7DFB1" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326252057 news.xs4all.nl 6959 [2001:888:2000:d::a6]:50713 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18800 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig51662C75BEA9015F07F7DFB1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 --------------enig51662C75BEA9015F07F7DFB1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----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----- --------------enig51662C75BEA9015F07F7DFB1--