Unable to read from files in /proc

Unable to read from files in /proc

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

1 post / novo 0
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.