AllenDang / w32

A wrapper of windows apis for the Go Programming Language.
Other
761 stars 245 forks source link

NTFS Change Journal #52

Closed tigerclawn82 closed 8 years ago

tigerclawn82 commented 8 years ago

Hi, Would it be possible to add NTFS Change Journal support? There's is example given in C++, if you can just guide i can also do that. Any help would be appreciated.

Thanks

hut8 commented 8 years ago

You probably already know this but if you can keep your program running all the time, you can use something that's already implemented, mature and cross-platform for change event notifications: What about https://github.com/go-fsnotify/fsnotify?

The answer to your question is "yes" it's possible. In fact probably pretty easy. Calling CreateFile (according to https://msdn.microsoft.com/en-us/library/aa365259(v=vs.85).aspx) followed by using this: https://msdn.microsoft.com/en-us/library/aa364558(v=vs.85).aspx

tigerclawn82 commented 8 years ago

I want to use this in a backup utility so watching for files changes when size is large eg:900GB, it would not scale well. USN Journal, it can work well as it already keeps tab on changed files so i can query USN Journal and copy files that are only changed.

Thanks for the https://github.com/go-fsnotify/fsnotify, i reviewed that and they are also not supporting USN Journal at this time.