How to get a directory file descriptor?

alex23 wuwei23 at gmail.com
Tue Nov 25 19:48:52 EST 2008


On Nov 26, 12:31 am, "D'Arcy J.M. Cain" <da... at druid.net> wrote:
> Is this what you want?
>
> ofiles = [open(x) for x in os.listdir(os.getcwd())]

'open' returns a "file object", whereas the OP is after "file
descriptors", which are returned by 'os.open'.




More information about the Python-list mailing list