You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if I missed a way to get around this, and I am not sure if this is the expected behaviour either, but when there is a watcher created for a parent directory for eg: /tmp/testdirectory, and if I moved the parent directory itself as /tmp/moved, any events inside /tmp/moved will be shown as /tmp/directory/, which is the old path.
Event is /tmp/directory notify.InCloseNowrite: "/tmp/directory"
Event is /tmp/directory notify.InCloseNowrite: "/tmp/directory"
Event is /tmp/directory/newdir notify.InCreate: "/tmp/directory/newdir"
Event is /tmp/directory/newdir notify.Create: "/tmp/directory/newdir"
Event is /tmp/directory/anotherdir notify.InCreate: "/tmp/directory/anotherdir"
Event is /tmp/directory/anotherdir notify.Create: "/tmp/directory/anotherdir"
Event is /tmp/directory notify.InCloseNowrite: "/tmp/directory"
Event is /tmp/directory/anotherdir notify.InCloseNowrite: "/tmp/directory/anotherdir"
(Shown as notify.InCreate: "/tmp/directory/anotherdir instead of notify.InCreate: "/tmp/moved/anotherdir" )
Is there any way when the parent directory is moved, it can reflect in the event's path with the updated directory name of the parent directory?
The text was updated successfully, but these errors were encountered:
Hey @nohupped , this is a bug in notify logic. Since inotify sends only file names, we store full paths in memory. However, when directory is moved, these paths are not updated.
Probably, we need to catch IN_MOVE_SELF events and update in-memory paths afterwards.
Note, that moving watched directories is generally not cross-platform - it is not possible to implement this correctly on Windows.
Apologies if I missed a way to get around this, and I am not sure if this is the expected behaviour either, but when there is a watcher created for a parent directory for eg:
/tmp/testdirectory
, and if I moved the parent directory itself as/tmp/moved
, any events inside /tmp/moved will be shown as/tmp/directory/
, which is the old path.Code:
Output:
Console:
Daemon output:
Console:
Daemon output:
(Shown as
notify.InCreate: "/tmp/directory/anotherdir
instead ofnotify.InCreate: "/tmp/moved/anotherdir"
)Is there any way when the parent directory is moved, it can reflect in the event's path with the updated directory name of the parent directory?
The text was updated successfully, but these errors were encountered: