31 #ifdef HAVE_SYS_MMAN_H 39 #include <mach-o/dyld.h> 41 #elif defined(__DragonFly__) 42 #include <sys/mount.h> 52 #if defined(__GNU__) && !defined(PATH_MAX) 53 # define PATH_MAX 4096 54 # define MAXPATHLEN 4096 57 #include <sys/types.h> 58 #if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \ 59 !defined(__linux__) && !defined(__FreeBSD_kernel__) 60 #include <sys/statvfs.h> 61 #define STATVFS statvfs 62 #define FSTATVFS fstatvfs 63 #define STATVFS_F_FRSIZE(vfs) vfs.f_frsize 65 #if defined(__OpenBSD__) || defined(__FreeBSD__) 66 #include <sys/mount.h> 67 #include <sys/param.h> 68 #elif defined(__linux__) 69 #if defined(HAVE_LINUX_MAGIC_H) 70 #include <linux/magic.h> 72 #if defined(HAVE_LINUX_NFS_FS_H) 73 #include <linux/nfs_fs.h> 75 #if defined(HAVE_LINUX_SMB_H) 76 #include <linux/smb.h> 81 #include <sys/mount.h> 83 #define STATVFS statfs 84 #define FSTATVFS fstatfs 85 #define STATVFS_F_FRSIZE(vfs) static_cast<uint64_t>(vfs.f_bsize) 88 #if defined(__NetBSD__) || defined(__DragonFly__) || defined(__GNU__) 89 #define STATVFS_F_FLAG(vfs) (vfs).f_flag 91 #define STATVFS_F_FLAG(vfs) (vfs).f_flags 102 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ 103 defined(__minix) || defined(__FreeBSD_kernel__) || defined(__linux__) || \ 104 defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX) || defined(__GNU__) 106 test_dir(
char ret[PATH_MAX],
const char *dir,
const char *bin)
109 char fullpath[PATH_MAX];
111 snprintf(fullpath, PATH_MAX,
"%s/%s", dir, bin);
112 if (!realpath(fullpath, ret))
114 if (stat(fullpath, &sb) != 0)
121 getprogpath(
char ret[PATH_MAX],
const char *bin)
127 if (test_dir(ret,
"/", bin) == 0)
133 if (strchr(bin,
'/')) {
135 if (!getcwd(cwd, PATH_MAX))
137 if (test_dir(ret, cwd, bin) == 0)
143 if ((pv = getenv(
"PATH")) ==
nullptr)
148 while ((t = strsep(&s,
":")) !=
nullptr) {
149 if (test_dir(ret, t, bin) == 0) {
157 #endif // __FreeBSD__ || __NetBSD__ || __FreeBSD_kernel__ 162 #if defined(__APPLE__) 166 char exe_path[MAXPATHLEN];
168 if (_NSGetExecutablePath(exe_path, &size) == 0) {
169 char link_path[MAXPATHLEN];
170 if (realpath(exe_path, link_path))
173 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ 174 defined(__minix) || defined(__DragonFly__) || \ 175 defined(__FreeBSD_kernel__) || defined(_AIX) 176 char exe_path[PATH_MAX];
178 if (getprogpath(exe_path, argv0) != NULL)
180 #elif defined(__linux__) || defined(__CYGWIN__) 181 char exe_path[MAXPATHLEN];
185 ssize_t len = readlink(aPath.str().c_str(), exe_path,
sizeof(exe_path));
191 len = std::min(len, ssize_t(
sizeof(exe_path) - 1));
192 exe_path[len] =
'\0';
198 #if _POSIX_VERSION >= 200112 || defined(__GLIBC__) 199 char *
real_path = realpath(exe_path, NULL);
200 std::string ret = std::string(real_path);
204 char real_path[MAXPATHLEN];
205 realpath(exe_path, real_path);
206 return std::string(real_path);
210 if (getprogpath(exe_path, argv0))
213 #elif defined(HAVE_DLFCN_H) && defined(HAVE_DLADDR) 216 int err = dladdr(MainAddr, &DLInfo);
222 char link_path[MAXPATHLEN];
223 if (realpath(DLInfo.dli_fname, link_path))
226 #error GetMainExecutable is not implemented on this host yet. 240 return UniqueID(fs_st_dev, fs_st_ino);
249 if (::STATVFS(Path.
str().c_str(), &Vfs))
250 return std::error_code(errno, std::generic_category());
251 auto FrSize = STATVFS_F_FRSIZE(Vfs);
252 space_info SpaceInfo;
253 SpaceInfo.capacity =
static_cast<uint64_t
>(Vfs.f_blocks) * FrSize;
254 SpaceInfo.free =
static_cast<uint64_t
>(Vfs.f_bfree) * FrSize;
255 SpaceInfo.available =
static_cast<uint64_t
>(Vfs.f_bavail) * FrSize;
262 const char *pwd = ::getenv(
"PWD");
268 result.
append(pwd, pwd + strlen(pwd));
269 return std::error_code();
280 if (::getcwd(result.
data(), result.
capacity()) ==
nullptr) {
283 return std::error_code(errno, std::generic_category());
291 return std::error_code();
298 if (::chdir(p.
begin()) == -1)
299 return std::error_code(errno, std::generic_category());
301 return std::error_code();
310 if (errno != EEXIST || !IgnoreExisting)
311 return std::error_code(errno, std::generic_category());
314 return std::error_code();
327 return std::error_code(errno, std::generic_category());
329 return std::error_code();
340 return std::error_code(errno, std::generic_category());
342 return std::error_code();
345 std::error_code
remove(
const Twine &path,
bool IgnoreNonExisting) {
347 StringRef p = path.toNullTerminatedStringRef(path_storage);
350 if (lstat(p.
begin(), &buf) != 0) {
351 if (errno != ENOENT || !IgnoreNonExisting)
352 return std::error_code(errno, std::generic_category());
353 return std::error_code();
361 if (!S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode) && !S_ISLNK(buf.st_mode))
364 if (::
remove(p.
begin()) == -1) {
365 if (errno != ENOENT || !IgnoreNonExisting)
366 return std::error_code(errno, std::generic_category());
369 return std::error_code();
372 static bool is_local_impl(
struct STATVFS &Vfs) {
373 #if defined(__linux__) || defined(__GNU__) 374 #ifndef NFS_SUPER_MAGIC 375 #define NFS_SUPER_MAGIC 0x6969 377 #ifndef SMB_SUPER_MAGIC 378 #define SMB_SUPER_MAGIC 0x517B 380 #ifndef CIFS_MAGIC_NUMBER 381 #define CIFS_MAGIC_NUMBER 0xFF534D42 388 case NFS_SUPER_MAGIC:
389 case SMB_SUPER_MAGIC:
390 case CIFS_MAGIC_NUMBER:
395 #elif defined(__CYGWIN__) 398 #elif defined(__Fuchsia__) 401 #elif defined(__HAIKU__) 408 return !fstype.equals(
"nfs");
410 return !!(STATVFS_F_FLAG(Vfs) & MNT_LOCAL);
416 if (::STATVFS(Path.
str().c_str(), &Vfs))
417 return std::error_code(errno, std::generic_category());
419 Result = is_local_impl(Vfs);
420 return std::error_code();
423 std::error_code
is_local(
int FD,
bool &Result) {
425 if (::FSTATVFS(FD, &Vfs))
426 return std::error_code(errno, std::generic_category());
428 Result = is_local_impl(Vfs);
429 return std::error_code();
440 return std::error_code(errno, std::generic_category());
442 return std::error_code();
446 #if defined(HAVE_POSIX_FALLOCATE) 449 if (
int Err = ::posix_fallocate(FD, 0, Size)) {
450 if (Err != EINVAL && Err != EOPNOTSUPP)
451 return std::error_code(Err, std::generic_category());
456 if (::ftruncate(FD, Size) == -1)
457 return std::error_code(errno, std::generic_category());
459 return std::error_code();
478 if (::
access(P.
begin(), convertAccessMode(Mode)) == -1)
479 return std::error_code(errno, std::generic_category());
484 if (0 != stat(P.
begin(), &buf))
486 if (!S_ISREG(buf.st_mode))
490 return std::error_code();
499 return A.fs_st_dev == B.fs_st_dev &&
500 A.fs_st_ino == B.fs_st_ino;
504 file_status fsA, fsB;
505 if (std::error_code ec =
status(A, fsA))
507 if (std::error_code ec =
status(B, fsB))
510 return std::error_code();
515 if (PathStr.empty() || !PathStr.startswith(
"~"))
531 Path[0] = Storage[0];
538 struct passwd *Entry =
nullptr;
540 Entry = ::getpwnam(User.c_str());
549 Path.
append(Entry->pw_dir, Entry->pw_dir + strlen(Entry->pw_dir));
560 expandTildeExpr(dest);
565 static file_type typeForMode(mode_t Mode) {
568 else if (S_ISREG(Mode))
570 else if (S_ISBLK(Mode))
572 else if (S_ISCHR(Mode))
574 else if (S_ISFIFO(Mode))
576 else if (S_ISSOCK(Mode))
578 else if (S_ISLNK(Mode))
583 static std::error_code fillStatus(
int StatRet,
const struct stat &
Status,
584 file_status &Result) {
586 std::error_code
EC(errno, std::generic_category());
595 #if defined(HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC) 596 atime_nsec = Status.st_atimespec.tv_nsec;
597 mtime_nsec = Status.st_mtimespec.tv_nsec;
598 #elif defined(HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) 599 atime_nsec = Status.st_atim.tv_nsec;
600 mtime_nsec = Status.st_mtim.tv_nsec;
602 atime_nsec = mtime_nsec = 0;
606 Result = file_status(typeForMode(Status.st_mode), Perms, Status.st_dev,
607 Status.st_nlink, Status.st_ino,
608 Status.st_atime, atime_nsec, Status.st_mtime, mtime_nsec,
609 Status.st_uid, Status.st_gid, Status.st_size);
611 return std::error_code();
614 std::error_code
status(
const Twine &Path, file_status &Result,
bool Follow) {
619 int StatRet = (Follow ? ::stat : ::lstat)(P.
begin(), &Status);
620 return fillStatus(StatRet, Status, Result);
623 std::error_code
status(
int FD, file_status &Result) {
625 int StatRet = ::fstat(FD, &Status);
626 return fillStatus(StatRet, Status, Result);
633 if (::chmod(P.
begin(), Permissions))
634 return std::error_code(errno, std::generic_category());
635 return std::error_code();
639 TimePoint<> ModificationTime) {
640 #if defined(HAVE_FUTIMENS) 644 if (::futimens(FD, Times))
645 return std::error_code(errno, std::generic_category());
646 return std::error_code();
647 #elif defined(HAVE_FUTIMES) 650 std::chrono::time_point_cast<std::chrono::microseconds>(AccessTime));
652 sys::toTimeVal(std::chrono::time_point_cast<std::chrono::microseconds>(
654 if (::futimes(FD, Times))
655 return std::error_code(errno, std::generic_category());
656 return std::error_code();
658 #warning Missing futimes() and futimens() 667 int flags = (Mode == readwrite) ? MAP_SHARED : MAP_PRIVATE;
668 int prot = (Mode == readonly) ? PROT_READ : (PROT_READ | PROT_WRITE);
669 #if defined(__APPLE__) 679 if (Mode == readonly) {
680 #if defined(MAP_RESILIENT_CODESIGN) 681 flags |= MAP_RESILIENT_CODESIGN;
683 #if defined(MAP_RESILIENT_MEDIA) 684 flags |= MAP_RESILIENT_MEDIA;
687 #endif // #if defined (__APPLE__) 689 Mapping = ::mmap(
nullptr, Size, prot, flags, FD, Offset);
690 if (Mapping == MAP_FAILED)
691 return std::error_code(errno, std::generic_category());
692 return std::error_code();
696 uint64_t offset, std::error_code &ec)
697 : Size(length), Mapping(), Mode(mode) {
699 ec =
init(fd, offset, mode);
704 mapped_file_region::~mapped_file_region() {
706 ::munmap(Mapping, Size);
710 assert(Mapping &&
"Mapping failed but used anyway!");
714 char *mapped_file_region::data()
const {
715 assert(Mapping &&
"Mapping failed but used anyway!");
716 return reinterpret_cast<char*
>(Mapping);
719 const char *mapped_file_region::const_data()
const {
720 assert(Mapping &&
"Mapping failed but used anyway!");
721 return reinterpret_cast<const char*
>(Mapping);
724 int mapped_file_region::alignment() {
730 bool follow_symlinks) {
732 DIR *directory = ::opendir(path_null.c_str());
734 return std::error_code(errno, std::generic_category());
736 it.IterationHandle =
reinterpret_cast<intptr_t>(directory);
739 it.CurrentEntry = directory_entry(path_null.str(), follow_symlinks);
744 if (it.IterationHandle)
745 ::closedir(reinterpret_cast<DIR *>(it.IterationHandle));
746 it.IterationHandle = 0;
747 it.CurrentEntry = directory_entry();
748 return std::error_code();
751 static file_type direntType(dirent* Entry) {
754 #if defined(_DIRENT_HAVE_D_TYPE) && defined(DTTOIF) 755 return typeForMode(DTTOIF(Entry->d_type));
758 return file_type::type_unknown;
764 dirent *CurDir = ::readdir(reinterpret_cast<DIR *>(It.IterationHandle));
765 if (CurDir ==
nullptr && errno != 0) {
766 return std::error_code(errno, std::generic_category());
767 }
else if (CurDir !=
nullptr) {
769 if ((
Name.size() == 1 &&
Name[0] ==
'.') ||
772 It.CurrentEntry.replace_filename(
Name, direntType(CurDir));
776 return std::error_code();
781 if (
auto EC =
fs::status(Path, s, FollowSymlinks))
786 #if !defined(F_GETPATH) 787 static bool hasProcSelfFD() {
790 static const bool Result = (
::access(
"/proc/self/fd", R_OK) == 0);
822 if (Flags & F_Append)
836 int OpenFlags = nativeOpenFlags(Disp, Flags, Access);
844 return std::error_code(errno, std::generic_category());
847 int r = fcntl(ResultFD, F_SETFD, FD_CLOEXEC);
849 assert(r == 0 &&
"fcntl(F_SETFD, FD_CLOEXEC) failed");
852 return std::error_code();
860 std::error_code
EC =
openFile(Name, FD, Disp, Access, Flags, Mode);
876 return std::error_code();
878 #if defined(F_GETPATH) 881 char Buffer[MAXPATHLEN];
882 if (::fcntl(ResultFD, F_GETPATH, Buffer) != -1)
883 RealPath->
append(Buffer, Buffer + strlen(Buffer));
885 char Buffer[PATH_MAX];
886 if (hasProcSelfFD()) {
888 snprintf(ProcPath,
sizeof(ProcPath),
"/proc/self/fd/%d", ResultFD);
889 ssize_t CharCount = ::readlink(ProcPath, Buffer,
sizeof(Buffer));
891 RealPath->
append(Buffer, Buffer + CharCount);
897 if (::realpath(P.
begin(), Buffer) !=
nullptr)
898 RealPath->
append(Buffer, Buffer + strlen(Buffer));
901 return std::error_code();
918 template <
typename T>
919 static std::error_code remove_directories_impl(
const T &Entry,
922 directory_iterator Begin(Entry, EC,
false);
923 directory_iterator End;
924 while (Begin != End) {
927 if (!st && !IgnoreErrors)
931 EC = remove_directories_impl(Item, IgnoreErrors);
932 if (EC && !IgnoreErrors)
937 if (EC && !IgnoreErrors)
941 if (EC && !IgnoreErrors)
944 return std::error_code();
948 auto EC = remove_directories_impl(path, IgnoreErrors);
949 if (EC && !IgnoreErrors)
952 if (EC && !IgnoreErrors)
954 return std::error_code();
961 return std::error_code();
966 expandTildeExpr(Storage);
972 char Buffer[PATH_MAX];
973 if (::realpath(P.
begin(), Buffer) ==
nullptr)
974 return std::error_code(errno, std::generic_category());
975 dest.
append(Buffer, Buffer + strlen(Buffer));
976 return std::error_code();
984 char *RequestedDir = getenv(
"HOME");
986 struct passwd *pw = getpwuid(getuid());
987 if (pw && pw->pw_dir)
988 RequestedDir = pw->pw_dir;
994 result.
append(RequestedDir, RequestedDir + strlen(RequestedDir));
999 #if defined(_CS_DARWIN_USER_TEMP_DIR) && defined(_CS_DARWIN_USER_CACHE_DIR) 1002 int ConfName = TempDir ? _CS_DARWIN_USER_TEMP_DIR
1003 : _CS_DARWIN_USER_CACHE_DIR;
1004 size_t ConfLen = confstr(ConfName,
nullptr, 0);
1008 ConfLen = confstr(ConfName, Result.
data(), Result.
size());
1009 }
while (ConfLen > 0 && ConfLen != Result.
size());
1023 static const char *getEnvTempDir() {
1026 const char *EnvironmentVariables[] = {
"TMPDIR",
"TMP",
"TEMP",
"TEMPDIR"};
1027 for (
const char *Env : EnvironmentVariables) {
1028 if (
const char *Dir = std::getenv(Env))
1035 static const char *getDefaultTempDir(
bool ErasedOnReboot) {
1049 if (ErasedOnReboot) {
1051 if (
const char *RequestedDir = getEnvTempDir()) {
1052 Result.
append(RequestedDir, RequestedDir + strlen(RequestedDir));
1057 if (getDarwinConfDir(ErasedOnReboot, Result))
1060 const char *RequestedDir = getDefaultTempDir(ErasedOnReboot);
1061 Result.
append(RequestedDir, RequestedDir + strlen(RequestedDir));
const file_t kInvalidFile
bool is_separator(char value, Style style=Style::native)
Check whether the given char is a path separator on the host OS.
bool can_execute(const Twine &Path)
Can we execute this file?
Represents either an error or a value T.
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
bool status_known(const basic_file_status &s)
Is status available?
This class represents lattice values for constants.
std::error_code openFileForRead(const Twine &Name, int &ResultFD, OpenFlags Flags=OF_None, SmallVectorImpl< char > *RealPath=nullptr)
Opens the file with the given name in a read-only mode, returning its open file descriptor.
void closeFile(file_t &F)
Close the file object.
std::error_code remove(const Twine &path, bool IgnoreNonExisting=true)
Remove path.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
bool isTriviallyEmpty() const
Check if this twine is trivially empty; a false return value does not necessarily mean the twine is e...
std::error_code setLastAccessAndModificationTime(int FD, TimePoint<> AccessTime, TimePoint<> ModificationTime)
Set the file modification and access time.
std::error_code current_path(SmallVectorImpl< char > &result)
Get the current path.
bool is_directory(const basic_file_status &status)
Does status represent a directory?
Expected< file_t > openNativeFile(const Twine &Name, CreationDisposition Disp, FileAccess Access, OpenFlags Flags, unsigned Mode=0666)
Opens a file with the specified creation disposition, access mode, and flags and returns a platform-s...
void reserve(size_type N)
std::error_code remove_directories(const Twine &path, bool IgnoreErrors=true)
Recursively delete a directory.
Represents the result of a call to sys::fs::status().
LLVM_ATTRIBUTE_ALWAYS_INLINE TimePoint< std::chrono::seconds > toTimePoint(std::time_t T)
Convert a std::time_t to a TimePoint.
CD_OpenExisting - When opening a file:
uint32_t fs_st_mtime_nsec
struct timespec toTimeSpec(TimePoint<> TP)
Convert a time point to struct timespec.
mapped_file_region()=delete
amode Optimize addressing mode
std::error_code directory_iterator_increment(DirIterState &)
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
std::error_code make_error_code(BitcodeError E)
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
Tagged union holding either a T or a Error.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef take_until(function_ref< bool(char)> F) const
Return the longest prefix of 'this' such that no character in the prefix satisfies the given predicat...
When a child process is launched, this file should remain open in the child process.
CD_CreateNew - When opening a file:
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
std::error_code is_local(const Twine &path, bool &result)
Is the file mounted on a local filesystem?
std::error_code create_link(const Twine &to, const Twine &from)
Create a link from from to to.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
std::string getMainExecutable(const char *argv0, void *MainExecAddr)
Return the path to the main executable, given the value of argv[0] from program startup and the addre...
std::error_code real_path(const Twine &path, SmallVectorImpl< char > &output, bool expand_tilde=false)
Collapse all .
initializer< Ty > init(const Ty &Val)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void expand_tilde(const Twine &path, SmallVectorImpl< char > &output)
Expands ~ expressions to the user's home directory.
std::error_code status(const Twine &path, file_status &result, bool follow=true)
Get file status as if by POSIX stat().
UniqueID getUniqueID() const
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
std::error_code getError() const
uint32_t getLinkCount() const
TimePoint getLastModificationTime() const
The file modification time as reported from the underlying file system.
StringRef toNullTerminatedStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single null terminated StringRef if it can be represented as such...
std::error_code resize_file(int FD, uint64_t Size)
Resize path to size.
auto RetryAfterSignal(const FailT &Fail, const Fun &F, const Args &... As) -> decltype(F(As...))
struct timeval toTimeVal(TimePoint< std::chrono::microseconds > TP)
Convert a time point to struct timeval.
uint32_t fs_st_atime_nsec
std::error_code create_hard_link(const Twine &to, const Twine &from)
Create a hard link from from to to, or return an error.
void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static unsigned getPageSize()
std::error_code rename(const Twine &from, const Twine &to)
Rename from to to.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
std::error_code directory_iterator_construct(DirIterState &, StringRef, bool)
Expected< file_t > openNativeFileForRead(const Twine &Name, OpenFlags Flags=OF_None, SmallVectorImpl< char > *RealPath=nullptr)
Opens the file with the given name in a read-only mode, returning its open file descriptor.
std::error_code setPermissions(const Twine &Path, perms Permissions)
Set file permissions.
iterator insert(iterator I, T &&Elt)
std::error_code set_current_path(const Twine &path)
Set the current path.
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
ErrorOr< space_info > disk_space(const Twine &Path)
Get disk space usage information.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
std::error_code directory_iterator_destruct(DirIterState &)
pointer data()
Return a pointer to the vector's buffer, even if empty().
file_type
An enumeration for the file system's view of the type.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
std::error_code create_directory(const Twine &path, bool IgnoreExisting=true, perms Perms=owner_all|group_all)
Create the directory in path.
std::string str() const
Return the twine contents as a std::string.
void system_temp_directory(bool erasedOnReboot, SmallVectorImpl< char > &result)
Get the typical temporary directory for the system, e.g., "/var/tmp" or "C:/TEMP".
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool equivalent(file_status A, file_status B)
Do file_status's represent the same thing?
CD_CreateAlways - When opening a file:
void set_size(size_t Size)
Set the array size to N, which the current array must have enough capacity for.
bool home_directory(SmallVectorImpl< char > &result)
Get the user's home directory.
std::error_code access(const Twine &Path, AccessMode Mode)
Can the file be accessed?
StringRef - Represent a constant reference to a string, i.e.
CD_OpenAlways - When opening a file:
TimePoint getLastAccessedTime() const
The file access time as reported from the underlying file system.
bool exists(const basic_file_status &status)
Does file exist?