MCPcopy Create free account
hub / github.com/apache/brpc / CreateTemporaryFile

Function CreateTemporaryFile

src/butil/file_util_posix.cc:489–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487#endif // !defined(OS_MACOSX)
488
489bool CreateTemporaryFile(FilePath* path) {
490 ThreadRestrictions::AssertIOAllowed(); // For call to close().
491 FilePath directory;
492 if (!GetTempDir(&directory))
493 return false;
494 int fd = CreateAndOpenFdForTemporaryFile(directory, path);
495 if (fd < 0)
496 return false;
497 close(fd);
498 return true;
499}
500
501FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) {
502 int fd = CreateAndOpenFdForTemporaryFile(dir, path);

Callers 1

TEST_FFunction · 0.85

Calls 3

AssertIOAllowedFunction · 0.85
GetTempDirFunction · 0.85

Tested by 1

TEST_FFunction · 0.68