[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Re: A List of Issues

From: <peter.westlake_at_arm.com>
Date: 2002-06-06 16:16:22 CEST

On 2002-06-06 14:54:11 "Martijn Boekhorst" wrote:
>> GetLongPathName() looks promising, but I don't have an easy way of
>> testing...
>That does what you want, but is Windows-2000 and up (NT5+)
>Try this instead :
>WIN32_FIND_DATA findData;
>if (h = FindFirstFile(argv[1], &findData)) {
> printf("\"%s\"\n", findData.cFileName);
> FindClose(h);
>It's two calls but doesn't scan the actual directory anymore than
>GetLongPathName would internally. (Only returnes the filename btw.)

You can follow FindFirstFile with calls to FindNextFile to loop
through all the files matching the pattern. This is mostly meant
for interpreting wildcards, but it will also find files whose
names differ only by case.

If you want to open a file in a case-sensitive way, pass the
FILE_FLAG_POSIX_SEMANTICS flag to CreateFile. You probably need
to do this in order to avoid opening "Foo" when asked for "foo".
Unfortunately, there doesn't seem to be a right thing to do in
general. If you were really feeling keen, you could use FindNextFile
to see if there was more than one file matching the name. If so,
open case-sensitively; if not, ignore case. But this would make for
rather unpredictable behaviour. Best to make it an option in the client.
For GUI clients, the file-opening dialog should cope a lot better.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jun 6 16:17:37 2002

This is an archived mail posted to the Subversion Dev mailing list.