/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>
#include <sys/stat.h>

int main(int argc, char *argv[])
{
    struct stat stbuf;
    stat(argv[1],&stbuf);
    if(S_ISDIR(stbuf.st_mode))
       printf("%s is a dir\n",argv[1]);
    else
       printf("%s is not a dir\n",argv[1]);
    return 0;
}
