How to reference a file named prn.c?

B

Bill Cohagan

Is there *any* way in Windows to deal with a file whose name is
prn.<something> (or con.<something> ...) in Windows? We've got some source
files that include some of these; e.g., prn.c, and unfortunately simply
changing the file name(s) is a major problem. These files normally live on a
Linux system so the "special" names aren't so special.

So is there any way to "escape" a file name so that Windows won't complain
(or not recognize) such files? Any other solution that doesn't involve
renaming the file?

Thanks in advance,
Bill
 
P

Pegasus \(MVP\)

Bill Cohagan said:
Is there *any* way in Windows to deal with a file whose name is
prn.<something> (or con.<something> ...) in Windows? We've got some source
files that include some of these; e.g., prn.c, and unfortunately simply
changing the file name(s) is a major problem. These files normally live on a
Linux system so the "special" names aren't so special.

So is there any way to "escape" a file name so that Windows won't complain
(or not recognize) such files? Any other solution that doesn't involve
renaming the file?

Thanks in advance,
Bill

These names are reserved names under Windows. You will have to
rename the files to acceptable names. Use this syntax for the renaming
action:

ren \\.\c:\LPT1.txt Something.txt
 
A

Ayush

Pegasus gave you the way, if you want to know more about it :
http://mjsabby.com/2005/10/windows-xp-con-folderfile-bug.php

--
Ayush [ Be ''?'' Happy ]

For any query, search > www.Google.com
Want to know about a term > http://en.wikipedia.org

Replied To :
-------------------------------------------------------------

: Is there *any* way in Windows to deal with a file whose name is
: prn.<something> (or con.<something> ...) in Windows? We've got some source
: files that include some of these; e.g., prn.c, and unfortunately simply
: changing the file name(s) is a major problem. These files normally live on a
: Linux system so the "special" names aren't so special.
:
: So is there any way to "escape" a file name so that Windows won't complain
: (or not recognize) such files? Any other solution that doesn't involve
: renaming the file?
:
: Thanks in advance,
: Bill
:
:
 
B

Bill Cohagan

Yes, I understand that they are reserved names under Windows. What I was
hoping was that there might be a way to escape the names so that the file
system would accept them. It is unfortunate that Windows apparently doesn't
provide any sort of workaround. As I said, for us renaming the files is not
a good option.

Thanks for the response.

Bill
 
P

Pegasus \(MVP\)

The syntax I gave you ***is*** a work-around but not
one that is recommended.
 
B

Bill Cohagan

As I said, we are not at liberty to change the file names; hence my wish for
a different workaround. It appears however that none exists.

Bill
 
B

Bill Cohagan

Well, it's a workaround except for the renaming part which, as I said, is
not available to us. In any case thanks for the response. It's pretty
interesting that you can use UNC to trick WinXP!

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top