Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: lib/System/Unix/Path.inc
- ===================================================================
- --- lib/System/Unix/Path.inc (revision 89338)
- +++ lib/System/Unix/Path.inc (working copy)
- @@ -454,6 +454,27 @@
- }
- bool
- +Path::isSpecial() const {
- + // Get the status so we can determin if its a file or directory
- + struct stat buf;
- + if (0 != stat(path.c_str(), &buf)) {
- + MakeErrMsg(ErrStr, path + ": can't get status of file");
- + return true;
- + }
- +
- + // Check catches strange situations. In all cases, LLVM should
- + // only be involved in the creation and deletion of regular files. This
- + // check ensures that what we're trying to work only on a regular file. It
- + // effectively prevents LLVM from erasing things like /dev/null, any block
- + // special file, or other things that aren't "regular" files.
- + if ( S_ISDIR(buf.st_mode) || S_ISREG(buf.st_mode) ) {
- + return false;
- + }
- +
- + return true;
- +}
- +
- +bool
- Path::canExecute() const {
- if (0 != access(path.c_str(), R_OK | X_OK ))
- return false;
Add Comment
Please, Sign In to add comment