/// in the file system.
bool canWrite() const;
- /// This function checks that what we're trying to work only on a regular file or directory.
- /// Check for things like /dev/null, any block special file,
+ /// This function checks that what we're trying to work only on a regular file
+ /// or directory. Check for things like /dev/null, any block special file,
/// or other things that aren't "regular" regular files or directories.
- bool isSpecialFile() const;
+ /// @returns true if the file is S_ISREG.
+ /// @brief Determines if the file is a regular file
+ bool isRegularFile() const;
/// This function determines if the path name references an executable
/// file in the file system. This function checks for the existence and
}
bool
-Path::isSpecialFile() const {
+Path::isRegularFile() const {
// Get the status so we can determine if its a file or directory
struct stat buf;
if (0 != stat(path.c_str(), &buf))
- return true;
-
- if (S_ISDIR(buf.st_mode) || S_ISREG(buf.st_mode))
return false;
- return true;
+ if (S_ISREG(buf.st_mode))
+ return true;
+
+ return false;
}
bool