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

Function CreateAndOpenTemporaryFileInDir

src/butil/file_util_posix.cc:501–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path) {
502 int fd = CreateAndOpenFdForTemporaryFile(dir, path);
503 if (fd < 0)
504 return NULL;
505
506 FILE* file = fdopen(fd, "a+");
507 if (!file)
508 close(fd);
509 return file;
510}
511
512bool CreateTemporaryFileInDir(const FilePath& dir, FilePath* temp_file) {
513 ThreadRestrictions::AssertIOAllowed(); // For call to close().

Callers 1

Calls 1

Tested by

no test coverage detected