CompuServe Thread

#Exists

3 messages in this thread
#44822From: Ash WyllieDec 18, 1994 9:13 PM
For reasons that I cannot figure, the exists function in this routine always returns 0. Can anyone tell me why? address command 'requestfile >ram:rq' if RC > 0 then do say "No file selected" exit end if ~open(1list,'ram:rq','r') then exit RESULT = readln(1list) parse var RESULT lead '.' num'.' trail do i=1 to 9999 fn= lead'.'i'.'trail say i fn exists(fn) if ~exists(fn) then leave 'rename >nil: ' fn 'as' lead'.'right('000'i,4)'.'trail end ANy help would be appreciated. -ash
#44837From: Bill HawesDec 19, 1994 7:58 PM
Are the filenames you're passing to exists() absolute or relative paths? You may have a problem with the current directory of the ARexx program being different from the files. Use pragma('dir') to check the CD of the ARexx program. And as a general debugging aid, put a TRACE R instruction near the top of your program. -Bill Hawes
#44849From: Ash WyllieDec 21, 1994 4:03 PM
Bill Found out what is going on. requestfile returns "filename" instead of filename, which confuses exists(). -ash