+/**
+ * @file apply-default-acl.c
+ *
+ * @brief The entire implementation.
+ *
+ */
+
/* On Linux, ftw.h needs this special voodoo to work. */
#define _XOPEN_SOURCE 500
static bool no_exec_mask = false;
+/**
+ * @brief Get the mode bits from the given path.
+ *
+ * @param path
+ * The path (file or directory) whose mode we want.
+ *
+ * @return A mode_t (st_mode) structure containing the mode bits.
+ * See sys/stat.h for details.
+ */
mode_t get_mode(const char* path) {
- /*
- * Get the mode bits from path.
- */
if (path == NULL) {
errno = ENOENT;
return -1;
}
+/**
+ * @brief Determine whether or not the given path is a regular file.
+ *
+ * @param path
+ * The path to test.
+ *
+ * @return true if @c path is a regular file, false otherwise.
+ */
bool is_regular_file(const char* path) {
- /*
- * Returns true if path is a regular file, false otherwise.
- */
if (path == NULL) {
return false;
}
}
}
+
+/**
+ * @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_directory(const char* path) {
- /*
- * Returns true if path is a directory, false otherwise.
- */
if (path == NULL) {
return false;
}