#56 Wrong behavior of cd (catch)

closed
nobody
None
5
2013-09-24
2009-05-13
No

If I give CD a parameter PATH to change to and PATH is not a directory but a file, the behavior of IDL and GDL differs:

IDL> PATH='/path/to/file.suffix'
IDL> CD,PATH
% CD: Unable to change current directory to /path/to/file.suffix.
Not a directory
% Execution halted at: $MAIN$
IDL>

________________

GDL> PATH='/path/to/file.suffix'
GDL> CD ,PATH
% CD: Unable to change current directory to: /path/to/file.suffix'.
% Execution halted at: $MAIN$
GDL>

I use CD to check, if PATH is a directory in this function:

FUNCTION is_dir,path

errvar=0
CATCH,errvar
IF errvar NE 0 THEN RETURN,0
CD,curr=curr,path
CD,curr
RETURN,1

END

Discussion

  • Sylwester Arabas

    • summary: Wrong behavior of cd --> Wrong behavior of cd (catch)
     
  • Sylwester Arabas

    It seems to be related to the functionality of the CATCH statement- I'm moving it to "feature requests".

    Sylwester

     
  • Alain C.

    Alain C. - 2013-09-24
    • status: open --> closed
    • Group: --> Next Release (example)
     
  • Alain C.

    Alain C. - 2013-09-24

    the small code provided here
    (and using CATCH)
    is perfectly working in GDL 0.9.3

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks