For PR351:
authorReid Spencer <rspencer@reidspencer.com>
Mon, 13 Dec 2004 20:08:14 +0000 (20:08 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 13 Dec 2004 20:08:14 +0000 (20:08 +0000)
Remove the MakeFileReadable and MakeFileExecutable functions which are no
longer present in LLVM. They have been replaced with the sys::Path methods
makeReadable and makeExecutable, respectively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18910 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/FileUtilities.h
lib/Support/FileUtilities.cpp

index b243df506b5513977bc6e83cb5511adee4a34548..36de66fcfdbe3568e0a4f1d38ac5769b72650a52 100644 (file)
@@ -49,18 +49,6 @@ void removeFile(const std::string &Filename);
 ///
 std::string getUniqueFilename(const std::string &FilenameBase);
 
-/// MakeFileExecutable - This method turns on whatever access attributes are
-/// needed to make the specified file executable.  It returns true on success.
-/// In case of failure, the file's access attributes are unspecified.
-///
-bool MakeFileExecutable(const std::string &Filename);
-
-/// MakeFileReadable - This method turns on whatever access attributes are
-/// needed to make the specified file readable.  It returns true on success.
-/// In case of failure, the file's access attributes are unspecified.
-///
-bool MakeFileReadable(const std::string &Filename);
-
 /// FDHandle - Simple handle class to make sure a file descriptor gets closed
 /// when the object is destroyed.  This handle acts similarly to an
 /// std::auto_ptr, in that the copy constructor and assignment operators
index ee83bc1a56a9cd424446b06189938ea51bea4d58..6cec414ee1aa881657aa57c903dec06003dbdc8a 100644 (file)
@@ -157,45 +157,6 @@ std::string llvm::getUniqueFilename(const std::string &FilenameBase) {
   return Result;
 }
 
-static bool AddPermissionsBits (const std::string &Filename, int bits) {
-  // Get the umask value from the operating system.  We want to use it
-  // when changing the file's permissions. Since calling umask() sets
-  // the umask and returns its old value, we must call it a second
-  // time to reset it to the user's preference.
-  int mask = umask(0777); // The arg. to umask is arbitrary.
-  umask(mask);            // Restore the umask.
-
-  // Get the file's current mode.
-  struct stat st;
-  if ((stat(Filename.c_str(), &st)) == -1)
-    return false;
-
-  // Change the file to have whichever permissions bits from 'bits'
-  // that the umask would not disable.
-  if ((chmod(Filename.c_str(), (st.st_mode | (bits & ~mask)))) == -1)
-    return false;
-
-  return true;
-}
-
-/// MakeFileExecutable - Make the file named Filename executable by
-/// setting whichever execute permissions bits the process's current
-/// umask would allow. Filename must name an existing file or
-/// directory.  Returns true on success, false on error.
-///
-bool llvm::MakeFileExecutable(const std::string &Filename) {
-  return AddPermissionsBits(Filename, 0111);
-}
-
-/// MakeFileReadable - Make the file named Filename readable by
-/// setting whichever read permissions bits the process's current
-/// umask would allow. Filename must name an existing file or
-/// directory.  Returns true on success, false on error.
-///
-bool llvm::MakeFileReadable(const std::string &Filename) {
-  return AddPermissionsBits(Filename, 0444);
-}
-
 //===----------------------------------------------------------------------===//
 // FDHandle class implementation
 //