At 09:16 PM 9/24/2009, Bill Niehaus wrote:

I am trying to determine if a directory exists on a computer.
If G:\ac  exists, then a file will be created there.

I tried to:
 cd g:\ac
 if sqlcode = 0 then
   create file in that directory
 endif

The sqlcode does not seem to change if the cd command succeeds
or fails.

Any suggestions on how to see if a subdirectory exists?


Bill,

Use the CHKFILE function of R:BASE to achieve your goal.

Here's how:

SET VAR vChkFile = (CHKFILE('G:\AC'))
IF vChkFile <> 1 THEN
   MD G:\AC
ENDIF

That's all there is to it!

Very Best R:egards,

Razzak.


Reply via email to