Code: Select all
(with-open-file (in #P"/sys/class/net/eth0/statistics/rx_bytes" :direction :input)
(read in))
I copy file sys/class/net/eth0/statistics/rx_bytes to my home folder, and with-open-file works.
I don't know why? Is this sbcl's bug?
Code: Select all
(with-open-file (in #P"/sys/class/net/eth0/statistics/rx_bytes" :direction :input)
(read in))
SBCL 1.0.18 1.0.19 on Debian sid (2.6.26-1-686) suck too.findinglisp wrote:Hmm... good question. When I try it, SBCL just hangs. I can interrupt it with C-c in a term window, but it never returns. A simple "cat /sys/class/net/eth0/statistics/rx_bytes" works just fine. This is with SBCL 1.0.17 on Fedora 8 (2.6.25.11 kernel).
Code: Select all
(let
((f (open #P"/sys/class/net/eth0/statistics/rx_bytes" :direction :input)))
(read-char f))
Have you posted it to sbcl mailing list. I haven't see at gmane.lisp.steel-bank.devel.findinglisp wrote:I would post it to the SBCL developer's mailing list and see what they have to say.
I test"/proc/stat" for read read-line with sbcl 1.0.20, it works.Exolon wrote:Does it happen with other weird 'virtual' mounted files - i.e. in /dev, /proc?
Code: Select all
(read-from-string
(trivial-shell:shell-command
"cat /sys/class/net/eth0/statistics/rx_bytes" ))
smithzv wrote:I think this is a bug, and a known issue for the sbcl people. In fact, I have a recollection of reading something about this and sbcl-devel a few months ago. I have searched throught the archives and found this,
http://sourceforge.net/mailarchive/mess ... hacker.com
So maybe snoop around that thread.
If you really need to access that data, you might go through the shell. Using trivial shell, something like this would work:
But, really this is a kludge at best.Code: Select all
(read-from-string (trivial-shell:shell-command "cat /sys/class/net/eth0/statistics/rx_bytes" ))
Zach