[Thread Prev][Thread Next][Index]
[ferret_users] combination of file and variable check crashes Ferret
Hello,
When I first check the existence of a file, open it if positive, and
then check the existence of a variable (isReady), Ferret crashes:
yes? let isFile = `test_opendap("a.nc")`
!-> DEFINE VARIABLE isFile = 0
yes? if `isFile eq 0` then
!-> if 1 then
yes? use b.nc
yes? say `aa[d=b.nc],return=isReady`
At line 89 of file depend_stat_var_sub.F
Fortran runtime error: Array reference out of bounds for array 'uvar_text', lower bound of dimension 1 exceeded (0 < 1)
yes? use b.nc
yes? say `aa[d=b.nc],return=isReady`
!-> MESSAGE/CONTINUE 0
0
Without checking the existence of the file, Ferret continues:
yes? use b.nc
yes? say `aa[d=b.nc],return=isReady`
!-> MESSAGE/CONTINUE 0
0
An alternative with using a symbol instead of a variable results in a
crash as well:
yes? def symbol isFile = `test_opendap("a.nc")`
!-> def symbol isFile = 0
yes? if `($isFile) eq 0` then
!-> if 1 then
yes? use b.nc
yes? say `aa[d=b.nc],return=isReady`
At line 89 of file depend_stat_var_sub.F
Fortran runtime error: Array reference out of bounds for array 'uvar_text', lower bound of dimension 1 exceeded (0 < 1)
As an alternative I tried the file check in Bash, but it does not work
right away:
yes? let isFile = spawn("[ -e b.nc ]; echo $?")
yes? say `isFile`
!-> MESSAGE/CONTINUE 0
0
yes? if `isFile eq 0` then
!-> if bad then
yes? say Does not work
yes? endif
yes? endif
yes? if `0 eq 0` then
!-> if 1 then
yes? say This works, though
This works, though
yes? endif
I'm also open to ideas to use the exit code of a bash command (instead
of using echo).
I'm using Ferret 6.9
Marco
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement