mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
fs_query: support querying file sizes
By adding an attribute 'size="yes"' to a query, one instructs fs_query to report also the size of each queried file as attribute 'size' of the corresponding 'file' node. Ref #4032
This commit is contained in:
parent
3ed26e7bb2
commit
dd587c6712
@ -12,3 +12,7 @@ content of the queried files is supplemented as body of the '<file>' nodes.
|
||||
The reported content is limited to 4 KiB per file. If the content is valid
|
||||
XML, the '<file>' node contains an attribute 'xml="yes"' indicating that
|
||||
the XML information is inserted as is. Otherwise, the content is sanitized.
|
||||
|
||||
Furthermore, a query can contain a 'size="yes"' attribute. If set, the size of
|
||||
each queried file is reported as number of bytes through an attribute 'size' in
|
||||
the corresponding '<file>' node.
|
||||
|
@ -88,6 +88,9 @@ struct Fs_query::Watched_file
|
||||
xml.node("file", [&] () {
|
||||
xml.attribute("name", _name);
|
||||
|
||||
if (query.attribute_value("size", false))
|
||||
xml.attribute("size", dir.file_size(_name));
|
||||
|
||||
if (_rwx.writeable)
|
||||
xml.attribute("writeable", "yes");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user