gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
276 stars 61 forks source link

special case in READF of single value without format #1712

Open alaingdl opened 10 months ago

alaingdl commented 10 months ago

In the Linux universe, the file /proc/sys/kernel/pid_max contains a single long integer indicating the max value for numbers of processes. I decided to read it to test if /proc/self is in between pid_min and pid_max for a test for #1709. Unfortunately :

OPENR, nlun, '/proc/sys/kernel/pid_max',/get
GDL> READF, nlun, pid
% End of file encountered. Unit: 100, File: /proc/sys/kernel/pid_max
% Execution halted at: $MAIN$          

It should not stop like that !

(testing on others files with and without CR gave same message)

If I provide a format it is now OK

GDL> OPENR, nlun, '/proc/sys/kernel/pid_max',/get
GDL> ipid=0L
GDL> READF, nlun, ipid, format='(i)'
GDL> ipid
       49152