GNOME Bugzilla – Bug 671518
If the interval between missing directory creation and file creation under the directory is short, gfilemonitor cannot get the create event of file under the directory.
Last modified: 2018-05-24 13:49:09 UTC
Created attachment 209127 [details] [review] 0001-add-filemonitor-test.patch, a test patch for glib, to detect the file changes of a missing directory 1. Create a gfilemonitor testcase, in order to detect the file changes of a missing directory. a) add patch "0001-add-filemonitor-test.patch" for glib package, based on commit number "6e8caec6d9af06d4f7f0e6cd1a86c6c47e49ff01" b) build glib package c) run glib/gio/tests/testgfilemonitor. 2. copy "file_monitor_test.sh" & "file_monitor_test.sh" under /tmp 3. run "file_monitor_test.sh" Filemonitor gets create event of missing directory, but cannot get the create event of files under this directory.
Created attachment 209128 [details] file_monitor_test.sh
Created attachment 209129 [details] file_monitor_test_sleep.sh, comparison test case of file_monitor_test.sh
If monitor a missing directory, gio checks whether the directory has been created every 4 seconds, if yes, add a watch to detect file changes under the directory. Otherwise, it won't add watch for the directory. If the interval of missing directory creation and file creation is usually less than 1 second. In conclusion, it is very possible that(possibility >= 75%) directory and photo file has been created while gio hasn’t add watch for the directory. Thus the create event of first photo file is lost.
If monitor a missing directory, gio checks whether the directory has been created every 4 seconds, if yes, add a watch to detect file changes under the directory. Otherwise, it won't add watch for the directory. If the interval of missing directory creation and file creation is short, it is very possible that directory and file has been created while gio hasn't add watch for the directory. Thus the create event of file cannot be detected.
please ignore this comment. (In reply to comment #3) > If monitor a missing directory, gio checks whether the directory has been > created every 4 seconds, if yes, add a watch to detect file changes under the > directory. Otherwise, it won't add watch for the directory. > > If the interval of missing directory creation and file creation is usually less > than 1 second. > In conclusion, it is very possible that(possibility >= 75%) directory and photo > file has been created while gio hasn’t add watch for the directory. Thus the > create event of first photo file is lost.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/521.