|
|||||||
Directory Exists on NovellFollowing on from an earlier article in which we showed how to check for the existence of a directory using OSOPEN and STATUS(), Claudio Aretusi of Michael D Atkin & Associates has submitted the following code to check for the existence of a directory under Novell (OSOPEN wouldn't work here as we are not interfacing with DOS anymore). 0001 FUNCTION CHECKDIR(DIR) 0002 * 0003 * Author Claudio Aretusi 0004 * Date November 2, 1989 0005 * Purpose To check if given directory exists 0006 * 0007 DECLARE FUNCTION UNASSIGNED 0008 IF UNASSIGNED(DIR) THEN DIR = "" 0009 * Normalise directory string to end in '\' 0010 DIR := '\' 0011 SWAP '\\' WITH '\' IN DIR 0012 OSWRITE 'DUMMY' TO DIR : "MDATEST.XXX" 0013 STAT = STATUS() 0014 IF STAT = 0 THEN 0015 * File created OK, dir exists, so delete test file 0016 OSDELETE DIR : "MDATEST.XXX" 0017 RETURN 1 0018 END ELSE 0019 * File not created, dir does not exist 0020 RETURN 0 0021 END (Volume 1, Issue 10, Page 10) |
|||||||
| |||||||