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
Improved "rename" support #26
Comments
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as spam.
This comment was marked as spam.
I think watchdog (https://github.com/gorakhargosh/watchdog) has figured out a cross-platform API, by the way. |
@jmhodges Do you have any more details on "Weird Things" vim does? Is this when saving or is there a rename file function people are using in Vim? |
ref: rjeczalik/notify#78 |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as outdated.
This comment was marked as outdated.
Do you think keeping a list of |
Having done some experimentation on Windows, the |
As mentioned here: howeyc/fsnotify#104
Currently, it's not straightforward to detect a rename correctly. In most cases, one will see this:
Yet this doesn't guarantee that
file1
andfile2
are the same file (there could be a file creation in between, orfile1
could be moved outside a watched folder andfile2
could be moved in). To work around this, one could store theos.FileInfo
for every watched file and useos.SameFile
to compare it with the new file. This is a bit cumbersome though, as it requires keeping a lot ofos.FileInfo
structs in memory + bookkeeping them.However, some platforms provide a way to atomically see what was the old name and what's the new name of a file. To quote @nathany:
This is a tracker issue to see if there is sufficient cross-platform support to enable this in the default API.
The text was updated successfully, but these errors were encountered: