diff options
author | gleb-kov <gleb-kov@yandex-team.ru> | 2022-02-10 16:46:22 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:22 +0300 |
commit | 7b1cfa32681104c8468c5824c79fd80d9a88a579 (patch) | |
tree | 499e0a6e0f35aba718ac262605efb4342996bdca /util/system/tempfile.h | |
parent | 89973d10cfeccd97d2f25449a523c93940565edf (diff) | |
download | ydb-7b1cfa32681104c8468c5824c79fd80d9a88a579.tar.gz |
Restoring authorship annotation for <gleb-kov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/tempfile.h')
-rw-r--r-- | util/system/tempfile.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util/system/tempfile.h b/util/system/tempfile.h index de249c129d..fb8ec62ec6 100644 --- a/util/system/tempfile.h +++ b/util/system/tempfile.h @@ -3,7 +3,7 @@ #include "fs.h" #include "file.h" -#include <util/folder/path.h> +#include <util/folder/path.h> #include <util/generic/string.h> class TTempFile { @@ -30,21 +30,21 @@ public: TTempFileHandle(); TTempFileHandle(const TString& fname); - static TTempFileHandle InCurrentDir(const TString& filePrefix = "yandex", const TString& extension = "tmp"); - static TTempFileHandle InDir(const TFsPath& dirPath, const TString& filePrefix = "yandex", const TString& extension = "tmp"); - + static TTempFileHandle InCurrentDir(const TString& filePrefix = "yandex", const TString& extension = "tmp"); + static TTempFileHandle InDir(const TFsPath& dirPath, const TString& filePrefix = "yandex", const TString& extension = "tmp"); + private: TFile CreateFile() const; }; - -/* - * Creates a unique temporary filename in specified directory. - * If specified directory is NULL or empty, then system temporary directory is used. - * - * Note, that the function is not race-free, the file is guaranteed to exist at the time the function returns, but not at the time the returned name is first used. - * Throws TSystemError on error. + +/* + * Creates a unique temporary filename in specified directory. + * If specified directory is NULL or empty, then system temporary directory is used. * - * Returned filepath has such format: dir/prefixXXXXXX.extension or dir/prefixXXXXXX - * But win32: dir/preXXXX.tmp (prefix is up to 3 characters, extension is always tmp). - */ -TString MakeTempName(const char* wrkDir = nullptr, const char* prefix = "yandex", const char* extension = "tmp"); + * Note, that the function is not race-free, the file is guaranteed to exist at the time the function returns, but not at the time the returned name is first used. + * Throws TSystemError on error. + * + * Returned filepath has such format: dir/prefixXXXXXX.extension or dir/prefixXXXXXX + * But win32: dir/preXXXX.tmp (prefix is up to 3 characters, extension is always tmp). + */ +TString MakeTempName(const char* wrkDir = nullptr, const char* prefix = "yandex", const char* extension = "tmp"); |