IO.read fails to read files in /proc filesystem on Linux
--------------------------------------------------------
Key: JRUBY-3688
URL: http://jira.codehaus.org/browse/JRUBY-3688
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.3RC1
Environment: Redhat Enterprise Linux 5, x86_64
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
Reporter: Rick Ohnemus
IO.read returns 0 bytes when reading /proc files. The following little snippet
will output "IO.read -> ..." when run with MRI and "File.open -> ..." when run
with jruby.
stat = IO.read("/proc/1/stat")
if stat.empty?
File.open("/proc/1/stat") do |x|
stat = x.sysread(16384)
puts "File.open -> #{stat.size}"
end
else
puts "IO.open -> #{stat.size}"
end
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email