Hello,
This behavior is a bug that has been filed. However, here is a workaround:
; Example program that uses the Windows DIR command
; to determine if target path is a directory or not.
FUNCTION dirtest, path
SPAWN, 'DIR /B /A:D "'+path+'"', out, err
RETURN, (WHERE(err EQ 'File Not Found'))[0] EQ -1 ? 1 : 0
END
;;;;;;;;;;;;;;;;;;
; Test call
target1 = FILEPATH('dist.pro', SUBDIRECTORY=['lib'])
target2 = FILEPATH('lib')
HELP, target1
PRINT, dirtest(target1) ? 'Target is a directory.' : 'Target is not a directory.'
HELP, target2
PRINT, dirtest(target2) ? 'Target is a directory.' : 'Target is not a directory.'
END
|