Re: How to verify the path of an open file.



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

.



Relevant Pages

  • Re: Where can I D/L ZA 2.6.362 ?
    ... > I use GetRight as a download manager, and the file is in my ... > indicates that the newer versions of Windows may be actually less secure ... BTW, I no longer use Internet Explorer, either. ... > So, short answer, I fired up GetRight and verified that the url ...
    (comp.security.firewalls)
  • Re: is it possible to...
    ... You cannot read each 5 ms because usual tick of windows is 10-15 ms, ... that you need to re-programming TIC, btw you can see that in Platform ... how can a little real time extension can be written? ... >> Venturcom wrote a real time OS and put it in the HAL layer of Windows. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Old 486 computer & external CD reader advice needed
    ... >>>So do many other apps, ... I think this>>>qualifies as "creating a new process". ... Linux is noticeably slower> on the same hardware. ... Windows > is not a cycle hog. ...
    (Fedora)
  • 1030 / 40961 / 673 on DC - MVP wanted
    ... Windows 2003 SP1 Domain 3 DC's ... BTW: I have already consulted www.eventid.net great resource but not ...
    (microsoft.public.windows.server.active_directory)
  • Re: Hosts file
    ... configuration with DNS Client set to Automatic. ... BTW: ... the memory installed at that time was 256MB ... I now have 768MB RAM with Windows XP Service Pack 2 installed. ...
    (microsoft.public.windowsxp.help_and_support)