Skip to contentSkip to conversation

Filesize in sysfs, debugfs, ...

DISCUSSION Stephan Müller 1 participant 1 message Jun 26, 2015

lore
Share & tools
lore
#0 lore raw

Hi all,

I have a question, what is the policy on file size in sysfs and especially in debugfs?

Many (but not all) of the files report a size of 0. Recently I diffed against a file in sysfs. The files were identical, despite the fact one reported size 0. I got the unpleasant result

diff -as file1 file2 (treat both as text, report identical files)
Files file1 and file2 are identical

diff -asq file1 file2 (treat both as text, report just yes/no)
Files file1 and file2 differ

In brief mode diff looks first for file sizes and stops if they don't match.

For files which don't differ in size (e.q, exposing a bool) it would be easy to set the proper size for others it's not.

Thank you,
Stephan