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:
Ingo Weinhold 2013-06-27 21:46:29 +02:00
parent cc4d194aeb
commit 04382d496e
3 changed files with 1948 additions and 921 deletions

View File

@ -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.
*/
#ifndef _PATH_MONITOR_H
@ -9,12 +9,23 @@
#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)
#define B_WATCH_FILES_ONLY 0x0100
#define B_WATCH_RECURSIVELY 0x0200
#define B_WATCH_RECURSIVELY 0x0100
// 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
// NOTE: B_WATCH_RECURSIVELY usually implies to watch for file changes as well,
// if that is not desired, add B_WATCH_DIRECTORIES_ONLY to the flags.
// A notification will only be sent when the node it concerns is a
// directory. No effect in non-recursive mode.
#define B_PATH_MONITOR '_PMN'
@ -69,4 +80,7 @@ public:
} // namespace BPrivate
using BPrivate::BPathMonitor;
#endif // _PATH_MONITOR_H

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src kits storage ;
SetSubDirSupportedPlatforms haiku libbe_test ;
UsePrivateHeaders app libroot shared storage ;
UsePrivateHeaders app kernel libroot shared storage ;
UsePrivateSystemHeaders ;
# for libbe_test

File diff suppressed because it is too large Load Diff