Connecting Tech Pros Worldwide Forums | Help | Site Map

Case-sensitive file name returned from FileSystemWatcher?

David Meier
Guest
 
Posts: n/a
#1: Nov 16 '05
Hi all,

I know, windows does not care about cases in file names, however, I need to
get the file name returned from the FileSystemWatcher case sensitive. Does
anyone know a workaround to this bug (at least that's what I think)? Thanks.

Dave

Drebin
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Case-sensitive file name returned from FileSystemWatcher?


First thing that comes to mind, is to make a MD5 or SHA1 hash from what the
filename SHOULD look like, then compare the testing filenames' hash against
that...

Seems kind of clunky, but should work.

"David Meier" <DavidMeier@discussions.microsoft.com> wrote in message
news:94DF1C9A-36CD-4200-AD2C-E49E79BA5C4E@microsoft.com...[color=blue]
> Hi all,
>
> I know, windows does not care about cases in file names, however, I need[/color]
to[color=blue]
> get the file name returned from the FileSystemWatcher case sensitive. Does
> anyone know a workaround to this bug (at least that's what I think)?[/color]
Thanks.[color=blue]
>
> Dave[/color]


Girish Bharadwaj
Guest
 
Posts: n/a
#3: Nov 16 '05

re: Case-sensitive file name returned from FileSystemWatcher?


It is a bug. See http://tinyurl.com/6om8g for a little more info. I guess
what you can do is to once you get that event, you can re-get the list.

After the Changed() event occurs:

string[] fi = Directory.GetFiles(<the directory>,<the file that
changed in lower case>);
fi[0] will contain the Case correct file name.

--
Girish Bharadwaj
http://msmvps.com/gbvb
"David Meier" <DavidMeier@discussions.microsoft.com> wrote in message
news:94DF1C9A-36CD-4200-AD2C-E49E79BA5C4E@microsoft.com...[color=blue]
> Hi all,
>
> I know, windows does not care about cases in file names, however, I need[/color]
to[color=blue]
> get the file name returned from the FileSystemWatcher case sensitive. Does
> anyone know a workaround to this bug (at least that's what I think)?[/color]
Thanks.[color=blue]
>
> Dave[/color]


Closed Thread


Similar C# / C Sharp bytes