Message 53327 - Python tracker (original) (raw)

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.