aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-02 00:51:20 +0000
committerChris Lattner <sabre@nondot.org>2004-06-02 00:51:20 +0000
commit2a7f15e50bf5e6ce0bf75fffb93ec5a4c6e025b6 (patch)
tree1bac53af8d001f911db26220dc14f8111c82c0f4
parentfff0ff83134dacb84ae8773a8b3cc2c2f3add0a4 (diff)
Add a new CopyFile function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13944 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/Support/FileUtilities.h6
-rw-r--r--include/llvm/Support/FileUtilities.h6
2 files changed, 10 insertions, 2 deletions
diff --git a/include/Support/FileUtilities.h b/include/Support/FileUtilities.h
index d5db63f6d7..78983b8352 100644
--- a/include/Support/FileUtilities.h
+++ b/include/Support/FileUtilities.h
@@ -53,6 +53,10 @@ bool FileOpenable(const std::string &Filename);
bool DiffFiles(const std::string &FileA, const std::string &FileB,
std::string *Error = 0);
+/// CopyFile - Copy the specified source file to the specified destination,
+/// overwriting destination if it exists. This returns true on failure.
+///
+bool CopyFile(const std::string &Dest, const std::string &Src);
/// MoveFileOverIfUpdated - If the file specified by New is different than Old,
/// or if Old does not exist, move the New file over the Old file. Otherwise,
@@ -60,7 +64,7 @@ bool DiffFiles(const std::string &FileA, const std::string &FileB,
///
void MoveFileOverIfUpdated(const std::string &New, const std::string &Old);
-/// removeFile - Delete the specified file
+/// removeFile - Delete the specified file.
///
void removeFile(const std::string &Filename);
diff --git a/include/llvm/Support/FileUtilities.h b/include/llvm/Support/FileUtilities.h
index d5db63f6d7..78983b8352 100644
--- a/include/llvm/Support/FileUtilities.h
+++ b/include/llvm/Support/FileUtilities.h
@@ -53,6 +53,10 @@ bool FileOpenable(const std::string &Filename);
bool DiffFiles(const std::string &FileA, const std::string &FileB,
std::string *Error = 0);
+/// CopyFile - Copy the specified source file to the specified destination,
+/// overwriting destination if it exists. This returns true on failure.
+///
+bool CopyFile(const std::string &Dest, const std::string &Src);
/// MoveFileOverIfUpdated - If the file specified by New is different than Old,
/// or if Old does not exist, move the New file over the Old file. Otherwise,
@@ -60,7 +64,7 @@ bool DiffFiles(const std::string &FileA, const std::string &FileB,
///
void MoveFileOverIfUpdated(const std::string &New, const std::string &Old);
-/// removeFile - Delete the specified file
+/// removeFile - Delete the specified file.
///
void removeFile(const std::string &Filename);