diff --git a/repos/gems/recipes/pkg/test-fs_tool/runtime b/repos/gems/recipes/pkg/test-fs_tool/runtime
index 8a96bccf9e..34278e5b03 100644
--- a/repos/gems/recipes/pkg/test-fs_tool/runtime
+++ b/repos/gems/recipes/pkg/test-fs_tool/runtime
@@ -10,7 +10,7 @@
[init -> report_rom] report 'test -> fs_query -> listing'
[init -> report_rom] <listing>
[init -> report_rom] <dir path="/fs/items">
- [init -> report_rom] <file name="1">first</file>
+ [init -> report_rom] <file name="1" writeable="yes">first</file>
[init -> report_rom] </dir>
[init -> report_rom] </listing>
diff --git a/repos/gems/run/fs_query.run b/repos/gems/run/fs_query.run
index 8a39a7d40f..f53bb68d02 100644
--- a/repos/gems/run/fs_query.run
+++ b/repos/gems/run/fs_query.run
@@ -190,9 +190,9 @@ regsub {.*report 'fs_query -> listing'} $output {} output
compare_output_to {
[init -> report_rom]
[init -> report_rom]
-[init -> report_rom] fourth
-[init -> report_rom] first
-[init -> report_rom] updated
+[init -> report_rom] fourth
+[init -> report_rom] first
+[init -> report_rom] updated
[init -> report_rom]
[init -> report_rom]
[init -> report_rom]
diff --git a/repos/gems/src/app/fs_query/main.cc b/repos/gems/src/app/fs_query/main.cc
index 9bfd197910..598e31264e 100644
--- a/repos/gems/src/app/fs_query/main.cc
+++ b/repos/gems/src/app/fs_query/main.cc
@@ -24,6 +24,7 @@ namespace Fs_query {
struct Watched_file;
struct Watched_directory;
struct Main;
+ using Node_rwx = Vfs::Node_rwx;
}
@@ -31,11 +32,13 @@ struct Fs_query::Watched_file
{
File_content::Path const _name;
+ Node_rwx const _rwx;
+
Watcher _watcher;
- Watched_file(Directory const &dir, File_content::Path name,
+ Watched_file(Directory const &dir, File_content::Path name, Node_rwx rwx,
Vfs::Watch_response_handler &handler)
- : _name(name), _watcher(dir, name, handler) { }
+ : _name(name), _rwx(rwx), _watcher(dir, name, handler) { }
virtual ~Watched_file() { }
@@ -68,6 +71,9 @@ struct Fs_query::Watched_file
xml.node("file", [&] () {
xml.attribute("name", _name);
+ if (_rwx.writeable)
+ xml.attribute("writeable", "yes");
+
if (query.attribute_value("content", false))
_gen_content(xml, alloc, dir);
});
@@ -110,7 +116,8 @@ struct Fs_query::Watched_directory
|| (entry.type() == Dirent_type::TRANSACTIONAL_FILE);
if (file) {
try {
- new (_alloc) Registered(_files, _dir, entry.name(), handler);
+ new (_alloc) Registered(_files, _dir, entry.name(),
+ entry.rwx(), handler);
} catch (...) { }
}
});