Thread overview | |||||
---|---|---|---|---|---|
|
June 25, 2004 weird /proc reading bug in linux | ||||
---|---|---|---|---|
| ||||
when reading /proc/sys/kernel/osrelease using: char[] thing = cast(char[])std.file.read("/proc/sys/kernel/osrelease") the string returned is completely empty.. its not a permission prob because cat has no probs, and either does C/C++.. And std.file.read works for other files it seems, just not ones in /proc (haven't tried to see if /dev reacts the same way). I'm guessing it might be because proc using procFS, not a standard filesystem Auzy http://driverondemand.sourceforge.net |
June 26, 2004 Re: weird /proc reading bug in linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrew Luecke | On Fri, 25 Jun 2004 06:42:34 +0000, Andrew Luecke wrote:
> when reading /proc/sys/kernel/osrelease using:
>
> char[] thing = cast(char[])std.file.read("/proc/sys/kernel/osrelease")
>
> the string returned is completely empty.. its not a permission prob because cat has no probs, and either does C/C++..
>
> And std.file.read works for other files it seems, just not ones in /proc (haven't tried to see if /dev reacts the same way). I'm guessing it might be because proc using procFS, not a standard filesystem
>
>
> Auzy
> http://driverondemand.sourceforge.net
proc files have 0 length
std.file.read gets the length of the file
and then gets that number of bytes - exactly 0 bytes.
Ant
|
February 16, 2009 Re: weird /proc reading bug in linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrew Luecke | Added to bugzill as http://d.puremagic.com/issues/show_bug.cgi?id=2670 |
Copyright © 1999-2021 by the D Language Foundation