Windows API Translation

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Feb 8 17:16:42 PST 2011


I don't know why I thought this would be easy. ReadDirectoryChangesW
is a b**ch to use. Someone even wrote a wrapper for it:
http://www.codeproject.com/KB/files/directorychangewatcher.aspx

It clocks in at over 1500 lines. For a single API function. Yikes!

Compare this to .Net's FileSystemWatcher. Create an object, pass a
delegate, and get back some info: Console.WriteLine("File: {0} renamed
to {1}", e.OldFullPath, e.FullPath);
Your work is done.

With ReadDirectoryChangesW I have to keep count of bytes to skip
forward, use casts and keep separate pointers and length variables.
Not to mention the function is not fully documented as this long blog
post shows:
http://qualapps.blogspot.com/2010/05/understanding-readdirectorychangesw.html


More information about the Digitalmars-d mailing list