-/**
- * @brief Determine whether or not the given path is a directory.
- *
- * @param path
- * The path to test.
- *
- * @return true if @c path is a directory, false otherwise.
- */
-bool is_path_directory(const char* path) {
- if (path == NULL) {
- return false;
- }
-
- struct stat s;
- int result = lstat(path, &s);
- if (result == 0) {
- return S_ISDIR(s.st_mode);
- }
- else {
- return false;
- }
-}
-
-
-/**
- * @brief Determine whether or not the given file descriptor is for
- * a directory.
- *
- * @param fd
- * The file descriptor whose directoryness is in question.
- *
- * @return true if @c fd describes a directory, and false otherwise.
- */
-bool is_directory(int fd) {
- if (fd <= 0) {
- return false;
- }
-
- struct stat s;
- int result = fstat(fd, &s);
- if (result == 0) {
- return S_ISDIR(s.st_mode);
- }
- else {
- return false;
- }
-}
-
-
-