-
-
Notifications
You must be signed in to change notification settings - Fork 405
Description
It seems like in order for this to work, you have to listen to both MOVED_FROM and MOVED_TO (or just MOVE). This is on a generic EXT4 fs, kernel 2.6.33, and inotifywait 3.13
Listening only to CREATE - file created in a renamed directory is shown with the directory's original name
[root@ein ~]# inotifywait -mrq -e create test &
[1] 14895
[root@ein ~]# cd test
[root@ein ~/test]# mkdir test
test/ CREATE,ISDIR test
[root@ein ~/test]# mv test test2
[root@ein ~/test]# cd test2
[root@ein ~/test/test2]# touch file
test/test/ CREATE file
Listening to CREATE and MOVED_TO - file created in a renamed directory is shown with the directory's original name
[root@ein ~]# inotifywait -mrq -e create -e moved_to test &
[1] 14909
[root@ein ~]# cd test
[root@ein ~/test]# mkdir test
test/ CREATE,ISDIR test
[root@ein ~/test]# mv test test2
test/ MOVED_TO,ISDIR test2
[root@ein ~/test]# cd test2
[root@ein ~/test/test2]# touch file
test/test/ CREATE file
Listening to CREATE, MOVED_TO, and MOVED_FROM - file created in a renamed directory is shown with the correct name
[root@ein ~]# inotifywait -mrq -e create -e moved_to -e moved_from test &
[1] 14918
[root@ein ~]# cd test
[root@ein ~/test]# mkdir test
test/ CREATE,ISDIR test
[root@ein ~/test]# mv test test2
test/ MOVED_FROM,ISDIR test
test/ MOVED_TO,ISDIR test2
[root@ein ~/test]# cd test2
[root@ein ~/test/test2]# touch file
test/test2/ CREATE file