- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't seem to read from /proc files, using both 6.0 and 7.0 versions of the compiler and runtime.
Using the following code snippet:
inquire(file="/proc/uptime",exist=ex)
if(ex) then
open(96,file="/proc/uptime")
read(96,*) rreadseed
close(96)
endif
I get the following error:
Input/Output Error 153: Input file ended
In Procedure: fetchseed
At Line: 49
Statement: List-Directed READ
Unit: 96
Connected To: /proc/uptime
Form: Formatted
Access: Sequential
Records Read : 0
Records Written: 0
End of diagnostics
I've also tried several other files (including ones with multiple lines), but I always get the same problem - it barfs when trying to read the first line.
Anyone know what's up with reading /proc files, and what the trick to making it work is?
Nick
Using the following code snippet:
inquire(file="/proc/uptime",exist=ex)
if(ex) then
open(96,file="/proc/uptime")
read(96,*) rreadseed
close(96)
endif
I get the following error:
Input/Output Error 153: Input file ended
In Procedure: fetchseed
At Line: 49
Statement: List-Directed READ
Unit: 96
Connected To: /proc/uptime
Form: Formatted
Access: Sequential
Records Read : 0
Records Written: 0
End of diagnostics
I've also tried several other files (including ones with multiple lines), but I always get the same problem - it barfs when trying to read the first line.
Anyone know what's up with reading /proc files, and what the trick to making it work is?
Nick
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page