about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-09-18 16:07:14 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-09-18 16:07:14 +0200
commit1d64cd27b5bb224fbbee3dbbded95a4e2c0c30ab (patch)
treedf6829da92ae181286dc11f82bd4f95b1534b4f8
parent227380d728b59e15a9dd93fb417a936ef596fd47 (diff)
downloadrwc-1d64cd27b5bb224fbbee3dbbded95a4e2c0c30ab.tar.gz
rwc-1d64cd27b5bb224fbbee3dbbded95a4e2c0c30ab.tar.xz
rwc-1d64cd27b5bb224fbbee3dbbded95a4e2c0c30ab.zip
also track IN_MOVED_FROM
moves to outside the watched directory are regarded as deletions
moves inside the watched directories are regarded as deletion and creation
-rw-r--r--rwc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rwc.c b/rwc.c
index 94fcdc2..fb2c638 100644
--- a/rwc.c
+++ b/rwc.c
@@ -97,7 +97,7 @@ main(int argc, char *argv[])
         while ((c = getopt(argc, argv, "0dep")) != -1)
 		switch(c) {
 		case '0': input_delim = 0; break;
-		case 'd': dflag = IN_DELETE | IN_DELETE_SELF; break;
+		case 'd': dflag = IN_DELETE|IN_DELETE_SELF|IN_MOVED_FROM; break;
 		case 'e': eflag++; break;
 		case 'p': pflag++; break;
 		default:
@@ -183,7 +183,8 @@ from_stdin:
 						break;
 				}
 				printf("%s%s%c",
-				    (ev->mask & IN_DELETE ? "- " : ""),
+				    (ev->mask & (IN_DELETE | IN_MOVED_FROM) ?
+				     "- " : ""),
 				    name,
 				    input_delim);
 				fflush(stdout);