Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
G
GLib
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 926
    • Issues 926
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 61
    • Merge Requests 61
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • GLib
  • Issues
  • #362

Closed
Open
Opened Oct 24, 2010 by bugzilla-migration@bugzilla-migrationReporter

GFileMonitor doesn't monitor root directory "/" (with test case)

Submitted by Hong Jen Yee

Link to original bug (#633014)

Description

Created attachment 173108 A simple test case demonstrating the bug.

I found that g_file_monitor_directory is not able to monitor "/".

I'm using glib 2.26 on Ubuntu 10.10. uname -a output: Linux thinkpad 2.6.35-22-generic #34-Ubuntu SMP Sun Oct 10 09:24:00 UTC 2010 i686 GNU/Linux

In the attachment is a simple test case demonstrating this bug. Just pass "/" as argv[1] to this test program, and do some changes inside /. Then you'll see nothing happens. No notification for any event is sent. If you pass your home directory or others, it works correctly.

The test case (also included in attachment):

#include <gtk/gtk.h> #include <gio/gio.h>

static void on_changed(GFileMonitor *monitor, GFile *file, GFile other_file, GFileMonitorEvent event_type, gpointer user_data) { char name = g_file_get_parse_name(file); g_debug("changed: %s", name); g_free(name); }

int main(int argc, char** argv) { gtk_init(&argc, &argv); if(argc > 1) { GFile gf = g_file_new_for_path(argv[1]); GFileMonitor mon = g_file_monitor_directory(gf, 0, NULL, NULL); g_signal_connect(mon, "changed", G_CALLBACK(on_changed), NULL); g_object_unref(gf); gtk_main(); g_file_monitor_cancel(mon); g_object_unref(mon); } return 0; }

Attachment 173108, "A simple test case demonstrating the bug.":
test.c

Version: 2.26.x

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/glib#362