diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-03 01:21:28 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-03 01:21:28 +0000 |
commit | 3cb84ef65dd417bc152fdaa173127966ca949318 (patch) | |
tree | 133d904ceb53dd1218f7c6857f0087c837960393 /include/llvm/Support/FileSystem.h | |
parent | f4e7b167a09df546b4b339ca9ebc445f747a724a (diff) |
Support/FileSystem: Add unique_file and exists implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/FileSystem.h')
-rw-r--r-- | include/llvm/Support/FileSystem.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h index 960853569f..46bb3d68ba 100644 --- a/include/llvm/Support/FileSystem.h +++ b/include/llvm/Support/FileSystem.h @@ -390,19 +390,21 @@ error_code symlink_status(const Twine &path, file_status &result); /// /// Generates a unique path suitable for a temporary file and then opens it as a /// file. The name is based on \a model with '%' replaced by a random char in -/// [0-9a-f]. +/// [0-9a-f]. If \a model is not an absolute path, a suitable temporary +/// directory will be prepended. /// /// This is an atomic operation. Either the file is created and opened, or the /// file system is left untouched. /// -/// clang-%%-%%-%%-%%-%%.s => <current-directory>/clang-a0-b1-c2-d3-e4.s +/// clang-%%-%%-%%-%%-%%.s => /tmp/clang-a0-b1-c2-d3-e4.s /// /// @param model Name to base unique path off of. -/// @param result Set to the opened file. -/// @results errc::success if result has been successfully set, otherwise a -/// platform specific error_code. -/// @see temp_directory_path -error_code unique_file(const Twine &model, void* i_have_not_decided_the_ty_yet); +/// @param result_fs Set to the opened file's file descriptor. +/// @param result_path Set to the opened file's absolute path. +/// @results errc::success if result_{fd,path} have been successfully set, +/// otherwise a platform specific error_code. +error_code unique_file(const Twine &model, int &result_fd, + SmallVectorImpl<char> &result_path); /// @brief Canonicalize path. /// |