-
Notifications
You must be signed in to change notification settings - Fork 8
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
Getting a FileEntry by path #12
Comments
Maybe this is an XY problem and the real solution would be to allow me to modify metadata using inotify. Doesn't really matter in the end |
Is Also since you say you are trying to get a handle after the rename, could it be that you are querying the old file by mistake? Also note that if inotify is used properly, the FileEntry object reference remains the same even after it is renamed, again this is assuming inotify was provided with appropriate info. |
I... did not know that function existed.
Considering I couldn't find out how to run any query, no.
Exactly, this is why it's not being populated with the correct metadata. I'll try out |
Turns out none of that was needed. The solution I settled on was to check if, during a rename, the new path is a different "kind" of file than the old path (as in the metadata needs changing). If so, just delete the old path and use an Added event to create the new one. The code looks something like this: |
Now I need this for a different reason - Alternatively |
Did you try the |
I did not know that existed, it has such a non-obvious name. I literally did search all the members of WatchOptions too. Thanks |
In my file watcher I'm performing some extra operations on certain files (when they're in a special folder, I do some parsing on them and set metadata so that the rendered items can display this data). I can't seem to get a hold of the FileEntry corresponding to some path.
I need to do this to update metadata when renames happen. My application uses atomic writes so I need to re-do the detection and parsing logic when something is renamed.
model.root.inotify
seems to know what to do with paths so how come I can't do the same?The text was updated successfully, but these errors were encountered: