Groups | Blog | Home
all groups > dotnet sdk > september 2004 >

dotnet sdk : How to get "Case-Sensitive" file name?


TK
9/10/2004 12:53:54 PM
Hi,

I have a problem to get a file name with case-sensitivity.

My application (actually an Windows service) is using
System.IO.FileSystemWatcher class to monitor file/folder operation by users.
It's working fine expect a point that the e.FullPath property has a path
name in lower case only.

My application is actually a "File Replication & Synchronization System"
type of application. And it have be able to work with other instances
running on separated Windows and Unix server machines. So my app have to
know and tell real file name to the 'teamed' instances on other nodes.

I tried pass the e.FullPath to System.IO.FileInfo then see FileInfo.Name and
FullName property, but no luck.

Why do these properties have strings in lower case only?

Any workarounds?

best reagards,
TK
Girish Bharadwaj
9/16/2004 3:19:01 PM
From what I can see , It looks like FileSystemWatcher does that explicitly within its handler for notification changes (in unmanaged hook). I might be totally wrong of course.

In its CompletionStatusChanged() handler, when it gets the name of the file, it explicitly converts it to lower case.
:(

I guess you probably will need to
1. Pass this as a bug so to MS.
2. Write your own win32 event notifications handler (probably in C++) which is not that hard.
Sorry.


--
Girish Bharadwaj
http://msmvps.com/gbvb

[quoted text, click to view]
TK
9/24/2004 7:40:58 AM
Thank you for your help Girish.
I'll follow you.

Thanks again,
TK

[quoted text, click to view]
within its handler for notification changes (in unmanaged hook). I might be
totally wrong of course.
[quoted text, click to view]
AddThis Social Bookmark Button