home *** CD-ROM | disk | FTP | other *** search
- /*
- * IsDir
- *
- * Confirms that the specified path is a directory.
- *
- * Copyright 1990 by J. Gregory Noel, All Rights Reserved.
- * Changes Copyright 1993 by Michael B. Smith, All Rights Reserved.
- */
-
- #include <libraries/dos.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "config.h"
- #include "version.h"
-
- IDENT (".02");
-
- Prototype int IsDir (const char *);
-
- int
- IsDir (const char *path)
- {
- int
- r = 0;
- BPTR
- lock;
- __aligned struct FileInfoBlock
- fib;
-
- if (lock = Lock ((UBYTE *) path, ACCESS_READ)) {
- if (Examine (lock, &fib))
- if (fib.fib_DirEntryType > 0)
- r = 1;
- UnLock (lock);
- }
-
- return r;
- }
-