BPathMonitor: rewrite
This resolves all issues the test suite uncovered. It should also deal with hard links correctly, though that hasn't been tested. Still unsupported are: * changes due to mounting/unmounting a volume, * tracking of symlinks in the path components.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007-2013, Haiku Inc. All Rights Reserved.
|
* Copyright 2007-2013, Haiku, Inc. All Rights Reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _PATH_MONITOR_H
|
#ifndef _PATH_MONITOR_H
|
||||||
@@ -9,12 +9,23 @@
|
|||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
|
|
||||||
|
|
||||||
|
// Monitoring a path always implies B_WATCH_NAME for the path itself. I.e. even
|
||||||
|
// if only B_WATCH_STAT is specified, B_ENTRY_{CREATED,MOVED,REMOVED}
|
||||||
|
// notifications are sent when the respective entry is created/moved/removed.
|
||||||
|
|
||||||
// additional flags (combined with those in NodeMonitor.h)
|
// additional flags (combined with those in NodeMonitor.h)
|
||||||
#define B_WATCH_FILES_ONLY 0x0100
|
#define B_WATCH_RECURSIVELY 0x0100
|
||||||
#define B_WATCH_RECURSIVELY 0x0200
|
// Watch not only the entry specified by the path, but also recursively all
|
||||||
|
// descendents. A recursive B_WATCH_DIRECTORY is implied, i.e.
|
||||||
|
// B_ENTRY_{CREATED,MOVED,REMOVED} notifications will be sent for any entry
|
||||||
|
// change below the given path, unless explicitly suppressed by
|
||||||
|
// B_WATCH_{FILES,DIRECTORIES}_ONLY.
|
||||||
|
#define B_WATCH_FILES_ONLY 0x0200
|
||||||
|
// A notification will only be sent when the node it concerns is not a
|
||||||
|
// directory. No effect in non-recursive mode.
|
||||||
#define B_WATCH_DIRECTORIES_ONLY 0x0400
|
#define B_WATCH_DIRECTORIES_ONLY 0x0400
|
||||||
// NOTE: B_WATCH_RECURSIVELY usually implies to watch for file changes as well,
|
// A notification will only be sent when the node it concerns is a
|
||||||
// if that is not desired, add B_WATCH_DIRECTORIES_ONLY to the flags.
|
// directory. No effect in non-recursive mode.
|
||||||
|
|
||||||
#define B_PATH_MONITOR '_PMN'
|
#define B_PATH_MONITOR '_PMN'
|
||||||
|
|
||||||
@@ -69,4 +80,7 @@ public:
|
|||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
|
||||||
|
using BPrivate::BPathMonitor;
|
||||||
|
|
||||||
|
|
||||||
#endif // _PATH_MONITOR_H
|
#endif // _PATH_MONITOR_H
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ SubDir HAIKU_TOP src kits storage ;
|
|||||||
|
|
||||||
SetSubDirSupportedPlatforms haiku libbe_test ;
|
SetSubDirSupportedPlatforms haiku libbe_test ;
|
||||||
|
|
||||||
UsePrivateHeaders app libroot shared storage ;
|
UsePrivateHeaders app kernel libroot shared storage ;
|
||||||
UsePrivateSystemHeaders ;
|
UsePrivateSystemHeaders ;
|
||||||
|
|
||||||
# for libbe_test
|
# for libbe_test
|
||||||
|
|||||||
+1928
-915
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user