Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试对根文件系统目录进行文件监视器。我使用g_file_new_for_path()with/作为路径并使用g_file_monitor(). 但在执行时没有报告任何事件。如果我使用路径//事件被抛出。
g_file_new_for_path()
/
g_file_monitor()
//
是 GIO 的错误还是我需要使用//?
来自以下文档g_file_new_for_path:
g_file_new_for_path
path : A string containing a relative or absolute path. The string must be encoded in the glib filename encoding
GLib 文件编码 iirc 是这样的: [protocol:]//path/to/file
[protocol:]//path/to/file
我认为这也应该起作用: file:/这是一个别名//
file:/