b8303f22da89371b05a46134dfddbb3e9515c408 hiram Fri Mar 23 10:27:55 2018 -0700 better error message from axtChain when 2bit or nib arguments do not exist refs #20928 diff --git src/lib/osunix.c src/lib/osunix.c index afa507c..d993cad 100644 --- src/lib/osunix.c +++ src/lib/osunix.c @@ -716,30 +716,41 @@ } void touchFileFromFile(const char *oldFile, const char *newFile) /* Set access and mod time of newFile from oldFile. */ { struct stat buf; if (stat(oldFile, &buf) != 0) errnoAbort("stat failed on %s", oldFile); struct utimbuf puttime; puttime.modtime = buf.st_mtime; puttime.actime = buf.st_atime; if (utime(newFile, &puttime) != 0) errnoAbort("utime failed on %s", newFile); } +boolean isDirectory(char *pathName) +/* Return TRUE if pathName is a directory. */ +{ +struct stat st; + +if (stat(pathName, &st) < 0) + return FALSE; +if (S_ISDIR(st.st_mode)) + return TRUE; +return FALSE; +} boolean isRegularFile(char *fileName) /* Return TRUE if fileName is a regular file. */ { struct stat st; if (stat(fileName, &st) < 0) return FALSE; if (S_ISREG(st.st_mode)) return TRUE; return FALSE; } char *mustReadSymlinkExt(char *path, struct stat *sb) /* Read symlink or abort. FreeMem the returned value. */