Remove Path::canExecute.
[oota-llvm.git] / lib / Support / Unix / Path.inc
index ea8a050accf153eba695845ee4aef6b5c5425e8d..f3e4b610563cf7a99c8bc52b30514b900b559eae 100644 (file)
@@ -109,14 +109,6 @@ Path::isValid() const {
   return !path.empty();
 }
 
-bool
-Path::isAbsolute(const char *NameStart, unsigned NameLen) {
-  assert(NameStart);
-  if (NameLen == 0)
-    return false;
-  return NameStart[0] == '/';
-}
-
 Path
 Path::GetTemporaryDirectory(std::string *ErrMsg) {
 #if defined(HAVE_MKDTEMP)
@@ -311,20 +303,6 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
   return Path();
 }
 
-bool Path::getMagicNumber(std::string &Magic, unsigned len) const {
-  assert(len < 1024 && "Request for magic string too long");
-  char Buf[1025];
-  int fd = ::open(path.c_str(), O_RDONLY);
-  if (fd < 0)
-    return false;
-  ssize_t bytes_read = ::read(fd, Buf, len);
-  ::close(fd);
-  if (ssize_t(len) != bytes_read)
-    return false;
-  Magic.assign(Buf, len);
-  return true;
-}
-
 bool
 Path::exists() const {
   return 0 == access(path.c_str(), F_OK );
@@ -346,17 +324,6 @@ Path::isSymLink() const {
   return S_ISLNK(buf.st_mode);
 }
 
-
-bool
-Path::canRead() const {
-  return 0 == access(path.c_str(), R_OK);
-}
-
-bool
-Path::canWrite() const {
-  return 0 == access(path.c_str(), W_OK);
-}
-
 bool
 Path::isRegularFile() const {
   // Get the status so we can determine if it's a file or directory
@@ -371,18 +338,6 @@ Path::isRegularFile() const {
   return false;
 }
 
-bool
-Path::canExecute() const {
-  if (0 != access(path.c_str(), R_OK | X_OK ))
-    return false;
-  struct stat buf;
-  if (0 != stat(path.c_str(), &buf))
-    return false;
-  if (!S_ISREG(buf.st_mode))
-    return false;
-  return true;
-}
-
 const FileStatus *
 PathWithStatus::getFileStatus(bool update, std::string *ErrStr) const {
   if (!fsIsValid || update) {
@@ -396,7 +351,6 @@ PathWithStatus::getFileStatus(bool update, std::string *ErrStr) const {
     status.mode = buf.st_mode;
     status.user = buf.st_uid;
     status.group = buf.st_gid;
-    status.uniqueID = uint64_t(buf.st_ino);
     status.isDir  = S_ISDIR(buf.st_mode);
     status.isFile = S_ISREG(buf.st_mode);
     fsIsValid = true;