-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Result #7
Comments
Verified. |
This is going to be a bit tougher:
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx Pull requests welcome 😄 |
any update ? |
Sorry, no. This goes over my C# / Windows programming skills (how can I find out This might be comparable to moving files across partitions on Unix. Although moving files is an atomic operation there, it only applies to the situtation when files are on the same file system (in other cases, it's a Anyways: I'm not sure this is possible due to the nature how moving files works on Windows. |
Alright, thanks. |
I would suggest comparing the hashed values. (The technique used in web frameworks to invalidate a cached file, if there has been a minor change by altering the filname, wich contains a hash value.) I think, knowing C#, which I don't, it's pretty straight forward. Here is the relevenat part copied from stackoverflow: You could use
Or... if you work with large files and do not want to load the whole file into memory:
You can compare to byte arrays from two files with
BTW, thanks for the good work! This is very relevant to boot2docker people working with windows and not beeing able to use fswath library: Connect it with rsync and you can use inotify autoreload features in your development cycle. |
Yes, I'd been thinking about this too. On the downside, this could be quite an issue for a 2 Gigabyte file on a Network drive... but even for smaller checkouts around 10 - 50 Megabytes but say with frequent changes this could be quite a performance hit. Maybe "fingerprinting" as suggested here, but that would mean keeping all files in memory when starting a watch (because what's the fingerprint of a deleted file? -> it would need to be calculated beforehand).
You're welcome! |
Reading through this blog, I'd say: For the usecase you're thinking about I think keeping the intelligence about replicating the changes in rsync is sufficient (it does this kind of fingerprinting AFAIK), and just using this tool to detect that there have been changes. |
I was about to say, the -c command of rsync does checksum, but not by default, as it is slow as you suggested... I'm working on a shellscript to do exactly what you suggest, leaving apart the moving case, as for development in case of reordering the file structure a need restarting the server is not that far fetched. |
When moving C:\Test\TestFolder1\testfile.txt to C:\Test\TestFolder2
It results in c:\Test DELETE TestFolder1\testfile.txt which is wrong,
should be
c:\Test MOVED_FROM TestFolder1\testfile.txt
c:\Test MOVED_TO TestFolder2\testfile.txt
The text was updated successfully, but these errors were encountered: