O_DIRECT on stdin?

Gordon Burditt gordonb.96bz4 at burditt.org
Mon Nov 7 14:48:47 EST 2005


>Is there a way of setting O_DIRECT on a preexisting file like sys.stdin?
>
>Does C allow this sort of thing?

There is no O_DIRECT or fcntl() in Standard C.

fcntl() operates on an open file descriptor, and the file descriptor
for stdin is 0.  Two calls to fcntl(), one with F_GETFL and one
with F_SETFL, would do what you want.

I'm not sure why you want to do that, though.  It's not going to
get you character-at-a-time I/O, if that's what you want.

						Gordon L. Burditt



More information about the Python-list mailing list