[Newbie Question] Matching directory content with variable

Kragen Sitaker kragen at pobox.com
Mon May 13 14:17:52 EDT 2002


Marcus Klein <marcus1 at marcus1.de> writes:
> I am trying to match a directory content with a variable to avoid 
> overwriting an existing file and it does not work.

Be aware case-insensitivity may bite you; os.path.exists() will help
with that.  Be aware also that race conditions may bite you; the file
may be created between when you check whether it exists and when you
start writing to it, which sometimes creates security holes.





More information about the Python-list mailing list