Re: How to verify the path of an open file.
- From: David Tiktin <dtiktin@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 26 Jul 2007 12:16:10 -0500
On 26 Jul 2007, David Tiktin <dtiktin@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
On 26 Jul 2007, max.trinitron@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.
Dave
--
D.a.v.i.d T.i.k.t.i.n
t.i.k.t.i.n [at] a.d.v.a.n.c.e.d.r.e.l.a.y [dot] c.o.m
.
- Follow-Ups:
- Re: How to verify the path of an open file.
- From: max . trinitron
- Re: How to verify the path of an open file.
- 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
- How to verify the path of an open file.
- Prev by Date: Re: How to verify the path of an open file.
- Next by Date: Re: Bignum looses precision too fast?
- Previous by thread: Re: How to verify the path of an open file.
- Next by thread: Re: How to verify the path of an open file.
- Index(es):
Relevant Pages
|