[llvm] r183827 - Remove Path::createFileOnDisk.
Rafael Espindola
rafael.espindola at gmail.com
Wed Jun 12 06:59:17 PDT 2013
Author: rafael
Date: Wed Jun 12 08:59:17 2013
New Revision: 183827
URL: http://llvm.org/viewvc/llvm-project?rev=183827&view=rev
Log:
Remove Path::createFileOnDisk.
Modified:
llvm/trunk/include/llvm/Support/PathV1.h
llvm/trunk/lib/Support/Unix/Path.inc
llvm/trunk/lib/Support/Windows/Path.inc
Modified: llvm/trunk/include/llvm/Support/PathV1.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PathV1.h?rev=183827&r1=183826&r2=183827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/PathV1.h (original)
+++ llvm/trunk/include/llvm/Support/PathV1.h Wed Jun 12 08:59:17 2013
@@ -458,17 +458,6 @@ namespace sys {
std::string* ErrMsg = 0 ///< Optional place to put error messages.
);
- /// This method attempts to create a file in the file system with the same
- /// name as the Path object. The intermediate directories must all exist
- /// at the time this method is called. Use createDirectoriesOnDisk to
- /// accomplish that. The created file will be empty upon return from this
- /// function.
- /// @returns true if the file could not be created, false otherwise.
- /// @brief Create the file this Path refers to.
- bool createFileOnDisk(
- std::string* ErrMsg = 0 ///< Optional place to put error messages.
- );
-
/// This is like createFile except that it creates a temporary file. A
/// unique temporary file name is generated based on the contents of
/// \p this before the call. The new name is assigned to \p this and the
Modified: llvm/trunk/lib/Support/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=183827&r1=183826&r2=183827&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc (original)
+++ llvm/trunk/lib/Support/Unix/Path.inc Wed Jun 12 08:59:17 2013
@@ -585,16 +585,6 @@ Path::createDirectoryOnDisk( bool create
}
bool
-Path::createFileOnDisk(std::string* ErrMsg) {
- // Create the file
- int fd = ::creat(path.c_str(), S_IRUSR | S_IWUSR);
- if (fd < 0)
- return MakeErrMsg(ErrMsg, path + ": can't create file");
- ::close(fd);
- return false;
-}
-
-bool
Path::createTemporaryFileOnDisk(bool reuse_current, std::string* ErrMsg) {
// Make this into a unique file name
if (makeUnique( reuse_current, ErrMsg ))
Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=183827&r1=183826&r2=183827&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Wed Jun 12 08:59:17 2013
@@ -560,18 +560,6 @@ Path::createDirectoryOnDisk(bool create_
}
bool
-Path::createFileOnDisk(std::string* ErrMsg) {
- // Create the file
- HANDLE h = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW,
- FILE_ATTRIBUTE_NORMAL, NULL);
- if (h == INVALID_HANDLE_VALUE)
- return MakeErrMsg(ErrMsg, path + ": Can't create file: ");
-
- CloseHandle(h);
- return false;
-}
-
-bool
Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const {
WIN32_FILE_ATTRIBUTE_DATA fi;
if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi))
More information about the llvm-commits
mailing list