This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author davidhopwood
Recipients
Date 2004-05-30.23:21:08
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=1053197

Device filenames can be detected by creating an empty
directory, and testing whether the filename exists in that
directory:

> md c:\empty
> if exist c:\empty\lpt1.txt echo foo
foo
> if exist c:\empty\lpt1.txt\lpt1.txt echo foo
foo
> if exist c:\empty\harmless echo foo
>

But note:
> if exist c:\empty\c:\lpt1.txt echo foo
> if exist c:\empty\:\lpt1.txt echo foo
>

I don't know why filenames containing ':' are treated
differently, but it might be wise to strip any ':' characters
from the path first.
History
Date User Action Args
2007-08-23 16:01:43adminlinkissue481171 messages
2007-08-23 16:01:43admincreate