After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
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.
If the interval between missing directory creation and file creation under th...
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-03-07 02:21 UTC by changbin
Modified: 2018-05-24 13:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-add-filemonitor-test.patch, a test patch for glib, to detect the file changes of a missing directory (2.11 KB, patch)
2012-03-07 02:21 UTC, changbin
none Details | Review
file_monitor_test.sh (155 bytes, application/x-shellscript)
2012-03-07 02:24 UTC, changbin
  Details
file_monitor_test_sleep.sh, comparison test case of file_monitor_test.sh (164 bytes, application/x-shellscript)
2012-03-07 02:26 UTC, changbin
  Details

Description changbin 2012-03-07 02:21:42 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.
Comment 1 changbin 2012-03-07 02:24:32 UTC
Created attachment 209128 [details]
file_monitor_test.sh
Comment 2 changbin 2012-03-07 02:26:42 UTC
Created attachment 209129 [details]
file_monitor_test_sleep.sh, comparison test case of file_monitor_test.sh
Comment 3 changbin 2012-03-07 02:33:55 UTC
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.
Comment 4 changbin 2012-03-07 02:36:36 UTC
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.
Comment 5 changbin 2012-03-07 02:39:30 UTC
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.
Comment 6 GNOME Infrastructure Team 2018-05-24 13:49:09 UTC
-- 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.