Remove Path::canWrite.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 18 Jun 2013 21:10:03 +0000 (21:10 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 18 Jun 2013 21:10:03 +0000 (21:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184235 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PathV1.h
lib/Support/Unix/Path.inc
lib/Support/Windows/Path.inc

index 146703c870b6d30be6821338afe7b314493426bc..550da319469beccc4bebcbfe54f924fa4cb07c95 100644 (file)
@@ -267,15 +267,6 @@ namespace sys {
       LLVM_ATTRIBUTE_DEPRECATED(bool isSymLink() const,
         LLVM_PATH_DEPRECATED_MSG(fs::is_symlink));
 
-      /// This function determines if the path name references a writable file
-      /// or directory in the file system. This function checks for the
-      /// existence and writability (by the current program) of the file or
-      /// directory.
-      /// @returns true if the pathname references a writable file.
-      /// @brief Determines if the path is a writable file or directory
-      /// in the file system.
-      bool canWrite() const;
-
       /// This function checks that what we're trying to work only on a regular
       /// file. Check for things like /dev/null, any block special file, or
       /// other things that aren't "regular" regular files.
index 658b67460cec5103d68a39e43e0018e294bc9367..fad2697cdb6abbf9108e18affdc5f5f52a114c95 100644 (file)
@@ -324,12 +324,6 @@ Path::isSymLink() const {
   return S_ISLNK(buf.st_mode);
 }
 
-
-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
index 7fe64f68e2fca2b61006b371295b37467420395c..de33fdbc6f3476e777b199c2798c011ba645c1e7 100644 (file)
@@ -243,13 +243,6 @@ Path::isSymLink() const {
   return attributes & FILE_ATTRIBUTE_REPARSE_POINT;
 }
 
-bool
-Path::canWrite() const {
-  // FIXME: take security attributes into account.
-  DWORD attr = GetFileAttributes(path.c_str());
-  return (attr != INVALID_FILE_ATTRIBUTES) && !(attr & FILE_ATTRIBUTE_READONLY);
-}
-
 bool
 Path::canExecute() const {
   // FIXME: take security attributes into account.