Using ReadDirectoryChangesW
1
Name:
Anonymous
2006-11-11 17:11
ReadDirectoryChangesW reports any changes to a folder (file being renamed, removed, etc).
Sometimes it returns long filenames, sometimes short.
Sometimes it's impossible to convert between long and short filenames (notably when a file is deleted).
Sometimes the short filename for a file changes without actually touching that file at all.
Is it possible to actually use that function reliably?
2
Name:
Anonymous
2006-11-11 17:49
Sorry.
3
Name:
Anonymous
2006-11-12 4:56
4
Name:
Anonymous
2006-11-12 11:46
5
Name:
Anonymous
2006-11-12 12:03
>>1
Unfortunately not. This behaviour is apparently by design.
See
http://support.microsoft.com/kb/290601 for details.
6
Name:
Anonymous
2006-11-12 12:42
7
Name:
Anonymous
2006-11-12 13:53
Use the CLR. It has functions similar to inotify.
8
Name:
Anonymous
2006-11-12 14:41
>>7
It uses ReadDirectoryChangesW internally to achieve this.
9
Name:
Anonymous-san
2006-11-12 15:06
>>5
"That's nut a bug, it's a feature."
And people wonder why I say Windows was in the pool when we closed it for AIDS?
10
Name:
Anonymous
2006-11-12 17:19
>>5
| An application would need to keep a cache of both short and long | file names to match them up when the notification is received.
Easy.
11
Name:
Anonymous
2006-11-13 2:20
12
Name:
Anonymous
2006-11-13 4:20
>>11
He's not using Linux, you fool.
13
Name:
Anonymous
2006-11-13 7:22
14
Name:
Anonymous
2006-11-13 8:43
>>13
ReadDirectoryChangesW is a Win32 API function, shithead
15
Name:
Anonymous
2006-11-13 10:33
>>14
Yeah, I know.
I use inotify.
Now GTFO.
16
Name:
Anonymous
2006-11-13 11:47
>>10
Tried that. Noticed that windows sometimes changes the short file name. orz
17
Name:
Anonymous
2006-11-13 11:53
>>15
Shut up. We weren't even talking about you and what you mess around with on Linux.
18
Name:
Anonymous
2006-11-13 12:19
>>17
WTF? If you aren't talking about me, then what are you talking about, HUH?
19
Name:
Anonymous
2006-11-13 12:36
Just disable short filenames in the registry, it's also faster, takes less space for huge dirs, and who wants them in NTFS anyways.
20
Name:
Anonymous
2006-11-13 14:47
>>19
can't expect every user to disable short filenames.
21
Name:
Anonymous
2006-11-13 15:06
(sage)
microsoft should have disabled short filenames before they shipped windows 2000.
22
Name:
Anonymous
2006-11-13 15:15
>>20
Let your installer do it for them, then.
23
Name:
Anonymous
2006-11-13 15:46
24
Name:
Anonymous
2006-11-13 16:44
>>23
No, you.
I am the goddamn king of /prog/.
25
Name:
Anonymous
2006-11-14 6:43
>>19
Silently disable it for him ;)
26
Name:
Anonymous
2006-11-14 13:05
Doesn't that just stop the short filename for new files?
27
Name:
Anonymous
2006-11-14 14:37
>>26
Yes. We are stuck with C:\PROGRA~1\ forever.
28
Name:
Anonymous
2006-11-14 15:17
Yes. W~1
29
Name:
Anonymous
2006-11-15 6:03
bump
30
Name:
Anonymous
2006-11-15 12:47
>>29
All hope is lost. There's nothing to add skipper.
31
Name:
Anonymous
2006-11-15 22:05
32
Name:
Anonymous
2006-11-15 22:09
33
Name:
Anonymous
2006-11-15 22:15
(sage)
Actually, I just tested it, and it becomes 'YES~1.WEA'.
34
Name:
Anonymous
2006-11-16 21:52
>>33 Here
Actually, I just tested it again, and I'm an idiot.
35
Name:
Anonymous
2006-11-16 22:58
38
Name:
Anonymous
2011-02-04 17:29