开发者

How do backup applications detect renames?

开发者 https://www.devze.com 2023-04-07 06:08 出处:网络
I recently noticed that SyncToy (by MS) can detect renamed and moved files. How do they do that? Is it only an elaborate guessing game based on file properties开发者_如何学Go (last modification date,

I recently noticed that SyncToy (by MS) can detect renamed and moved files.

How do they do that? Is it only an elaborate guessing game based on file properties开发者_如何学Go (last modification date, creation date, and file size)?


One way to catch file renames, deletes and other is to use FileSystemWatcher class (using dotnet framework).
If you develop an application (or a service) you can monitor file system changes and execute a custom action (with your code, so you can do anything you need).
You can even set which directory monitor and if you want subdirs too.
Problems can arise with permissions on folders and files, but this is not part of your question :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号