From b948c235b83e43441faeed257cfdffa2008326d9 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Tue, 6 Apr 2021 13:48:48 -0700 Subject: fs,extension: Make truncate work on cached file content. We now remember the path of each cached file, so when someone truncates that path, we can truncate all open instances of it in cache. Important when someone pipes to stomp a file / opens with O_TRUNC (which FUSE disaggregates into an open() and then a truncate() call). Gets rid of the need for FUSE_CAP_ATOMIC_O_TRUNC, which never worked on macOS anyway. Fixes #40. --- test/test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/test.c b/test/test.c index 4ad3dd3..b463f89 100644 --- a/test/test.c +++ b/test/test.c @@ -79,9 +79,9 @@ int main() { fclose(result); } - // try to shorten the URL (#40) - /* assert(system("echo about:blank > ../fs/mnt/tabs/last-focused/url.txt") == 0); */ - /* assert(file_contents_equal("../fs/mnt/tabs/last-focused/url.txt", "about:blank")); */ + // try to truncate & stomp the URL (#40) + assert(system("echo about:blank > ../fs/mnt/tabs/last-focused/url.txt") == 0); + assert(file_contents_equal("../fs/mnt/tabs/last-focused/url.txt", "about:blank")); assert(system("echo remove > ../fs/mnt/tabs/last-focused/control") == 0); } -- cgit v1.2.3