os.path.isdir do not work for Foder named '2011-07-03'

Kushal Das kushaldas at gmail.com
Tue Jul 19 00:41:35 EDT 2011


2011/7/19 Nulpum <changjun.cho at gmail.com>:
> I want to make sure that folder exists.
>
> '2011-07-03' is really exists. but 'os.path.isdir' say false
>
> Does anyone know why?
>
>
>
>>>> os.path.isdir("C:\Users\조창준\Desktop\logs")
> True
>>>> os.path.isdir("C:\Users\조창준\Desktop\logs\2011-07-03")
> False
Works here. Are you sure that it is not a file ?

>>> os.path.isdir('/tmp/2011-07-03')
True

Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2


Kushal
-- 
http://fedoraproject.org
http://kushaldas.in



More information about the Python-list mailing list