* 2.5.86+: sizes of almost all files in sysfs are 4k?
@ 2003-04-23 8:27 Alex Riesen
2003-05-13 16:58 ` Patrick Mochel
0 siblings, 1 reply; 3+ messages in thread
From: Alex Riesen @ 2003-04-23 8:27 UTC (permalink / raw)
To: Patrick Mochel; +Cc: linux-kernel
This confuses some applications (i.e., the midnight commander).
Was this intended?
If the size is not simple/possible to calculate, maybe using 0
would be an option for the cases where the size doesn't carry
any information (like in procfs)?
-alex
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 2.5.86+: sizes of almost all files in sysfs are 4k?
2003-04-23 8:27 2.5.86+: sizes of almost all files in sysfs are 4k? Alex Riesen
@ 2003-05-13 16:58 ` Patrick Mochel
2003-05-13 17:05 ` Alex Riesen
0 siblings, 1 reply; 3+ messages in thread
From: Patrick Mochel @ 2003-05-13 16:58 UTC (permalink / raw)
To: Alex Riesen; +Cc: linux-kernel
On Wed, 23 Apr 2003, Alex Riesen wrote:
> This confuses some applications (i.e., the midnight commander).
>
> Was this intended?
Yes. This was done at the request of one annoying konqueror user that
wanted it to be smart enough to define a default handler for the text
files, so he could click on it and get a preview of the contents in the
sidebar.
[ I know it's a pretty poor reason to add a feature, but I caved anyway. ]
> If the size is not simple/possible to calculate, maybe using 0
> would be an option for the cases where the size doesn't carry
> any information (like in procfs)?
It was 0 before, which works fine for cat(1). By hardcoding the size, some
bugs are exposed, since the size is reset for some reason when you try to
open the file for writing, even if open(2) returns an error.
Ideally, we should be calculating the size, and using that. However, that
would involve keeping type information about the file around, which we
don't currently do. Research/patches in this area would be greatly
appreciated.
-pat
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 2.5.86+: sizes of almost all files in sysfs are 4k?
2003-05-13 16:58 ` Patrick Mochel
@ 2003-05-13 17:05 ` Alex Riesen
0 siblings, 0 replies; 3+ messages in thread
From: Alex Riesen @ 2003-05-13 17:05 UTC (permalink / raw)
To: Patrick Mochel; +Cc: linux-kernel
Patrick Mochel, Tue, May 13, 2003 18:58:34 +0200:
> > If the size is not simple/possible to calculate, maybe using 0
> > would be an option for the cases where the size doesn't carry
> > any information (like in procfs)?
>
> It was 0 before, which works fine for cat(1). By hardcoding the size, some
> bugs are exposed, since the size is reset for some reason when you try to
> open the file for writing, even if open(2) returns an error.
>
> Ideally, we should be calculating the size, and using that. However, that
> would involve keeping type information about the file around, which we
> don't currently do. Research/patches in this area would be greatly
> appreciated.
we could also pretend the files are sparse, and return zero-filled data.
Though, i fear, this will also confuse something.
-alex
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-13 16:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-23 8:27 2.5.86+: sizes of almost all files in sysfs are 4k? Alex Riesen
2003-05-13 16:58 ` Patrick Mochel
2003-05-13 17:05 ` Alex Riesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).