Directory Traversal

Hans Nowak hnowak at cuci.nl
Wed Mar 1 17:44:16 EST 2000


On 1 Mar 00, at 16:42, Alexander, Jason wrote:

> Hey all,
> 
> 
> On my current project I'm attempting to traverse down a given directory,
> and I'm coming across the dilemma of having a difficult time being able to
> discern a file from a directory when using the os.listdir() call... can
> anyone give any insight to this?

You can use os.path.isfile to check if a name is a file or a directory.

HTH,

--Hans Nowak (zephyrfalcon at hvision.nl)
Homepage: http://fly.to/zephyrfalcon
You call me a masterless man. You are wrong. I am my own master.




More information about the Python-list mailing list