Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Declined
-
Affects Version/s: Release 1.3
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:linux
Description
On my machine,
(slurp "/proc/cpuinfo")
fails with:
java.io.IOException: Argument invalide (NO_SOURCE_FILE:0)
whereas the following succeeds:
(with-open [f (java.io.FileReader. "/proc/cpuinfo")] (slurp f))
It seems this is not an error in Clojure but an error in the native implementation of FileInputStream.available(). For example, this Java code throws the same exception.
FileInputStream fis = new FileInputStream("/home/horn/dead.letter"); System.out.println(fis.available()); // Works fine fis = new FileInputStream("/proc/cpuinfo"); System.out.println(fis.available()); // IOException is thrownTested with sun-jdk 1.6.0.29 and IcedTea 7.2.0.
FileInputStream fis = new FileInputStream("/home/horn/dead.letter"); System.out.println(fis.available()); // Works fine fis = new FileInputStream("/proc/cpuinfo"); System.out.println(fis.available()); // IOException is thrown