$include (..\lib\compStch.ext) /* *============================================================================ * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE * * Permission to use for any purpose, modify, copy, and make enhancements * and derivative works of the software is granted if attribution is given to * R.M. Gillmore, dba the ACME Software Deli, as the author * * While the ACME Software Deli does not work for money, there is nonetheless * a significant amount of work involved. The ACME Software Deli maintains the * rights to all code written, though it may be used and distributed as long as * the following conditions are maintained. * * 1. The copyright statement at the top of each code block is maintained in * your distribution. * 2. You do not identify yourself as the ACME Software Deli * 3. Any changes made to the software are sent to the ACME Software Deli *============================================================================ */ isDirModule: do; $if not noID declare IDString (*) byte data ( '@(#)isDir.p86 $Author: rmgillmore $ $Date:: 2025-05-04 19:35:39#$:', 0 ); $endif $include (..\lib\comnDefs.ext) $set (isDirImplementation=1) $include (..\lib\dirFunct.ext) $include (..\lib\curDir.ext) $include (..\lib\string.ext) isDir: procedure ( pathStringPtr ) boolean reentrant public; declare pathStringPtr pointer, pathString based pathStringPtr (*) char; declare aDirSpecified boolean, chdirReturned word, currentDirectory ( MAX_PATH ) char; /* * what we will do is attempt to change to the directory specified. If that is * successful, we obviously have a directory */ call getcwd( @currentDirectory ); chdirReturned = chdir( pathStringPtr ); if ( 0 = chdirReturned ) then do; /* * we were able to change to the directory, so it is (obviously) a directory. * we also need to change back to the directory where all of the work started */ aDirSpecified = True; chdirReturned = chdir( @currentDirectory ); end; else do; /* * could not change, so we are not a directory */ aDirSpecified = False; end; return ( aDirSpecified ); end isDir; end isDirModule;