Re: How to verify the path of an open file.
- From: max.trinitron@xxxxxxx
- Date: Fri, 27 Jul 2007 00:11:51 -0700
On 26 Jul., 19:16, David Tiktin <dtik...@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
On 26 Jul 2007, David Tiktin <dtik...@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
On 26 Jul 2007, max.trinit...@xxxxxxx wrote:
Under UNIX/Linux you open a file with
fopen("anyDirectory/MyFile" "r")
and when it succeeds you know that the filename (and path) of the
file opened is exactly what you requested (otherwise you get
NULL). Under Windows the search for a file is case insensitive.
You may just have opened the file "AnyDirectory/myFile".
In such a case I want to write an error message (This should lead
to better portability between UNIX/Linux and Windows).
Is there a simple way to verify that the right file (case
sensitive filename compare) has been opened.
You're probably better off asking in an Microsoft specific
newsgroup, but you might want to look at the GetLongPathName()
function. It gives you the case-preserved full path name. But
I'm not sure if that qualifies as a simple way ;-)
BTW, I forgot to mention that "anyDirectory/MyFile" and
"AnyDirectory/myFile" are the same file as is "ANYdirECTory/MYfile".
It's case insensitive! You can't have 2 file names that differ only
in case. You can check this yourself by trying to create 2 such
files.
Yes, I know.
I just want to know when fopen("anyDirectory/MyFile", "r")
opens the file "ANYdirECTory/MYfile" instead of
"anyDirectory/MyFile".
Max Trinitron
.
- References:
- How to verify the path of an open file.
- From: max . trinitron
- Re: How to verify the path of an open file.
- From: David Tiktin
- Re: How to verify the path of an open file.
- From: David Tiktin
- How to verify the path of an open file.
- Prev by Date: Re: What should be in a CS degree?
- Next by Date: Choosing a PL - What you can do or how you do it?
- Previous by thread: Re: How to verify the path of an open file.
- Next by thread: Choosing a PL - What you can do or how you do it?
- Index(es):
Relevant Pages
|