Skip to content

Commit 791a944

Browse files
committed
Merge branch 'gpimm/INSTX-11836_tweak_tmp_file_naming' into 'master'
INSTX-11836 Tidying pod5 naming Closes INSTX-11836 See merge request minknow/pod5-file-format!439
2 parents 4db9436 + 180c7a4 commit 791a944

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
- Fixed migration behaviour on nfs systems, where migrated tables could be left orphaned on disk.
1919
- Limited polars install version to "~=1.20,<1.32" following breaking changes
20+
- Tidied up how tmp files are named, used a larger set of numbers for naming.
2021

2122
## [0.3.33]
2223

c++/pod5_format/migration/migration.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ namespace pod5 {
66

77
Result<std::unique_ptr<TemporaryDir>> MakeTmpDir(char const * suffix)
88
{
9-
std::uint32_t counter = 0;
10-
while (counter < 3) {
9+
std::default_random_engine gen(
10+
static_cast<std::default_random_engine::result_type>(arrow::internal::GetRandomSeed()));
11+
12+
for (std::uint32_t counter = 0; counter < 5; ++counter) {
1113
std::string tmp_path = std::string{".tmp_"} + suffix;
1214

13-
std::default_random_engine gen(
14-
static_cast<std::default_random_engine::result_type>(arrow::internal::GetRandomSeed()));
15-
std::uniform_int_distribution<int> dist(0, 1024);
16-
tmp_path += "_" + std::to_string(dist(gen));
15+
tmp_path += "_" + std::to_string(gen());
1716

1817
ARROW_ASSIGN_OR_RAISE(
1918
auto filename, arrow::internal::PlatformFilename::FromString(tmp_path));

0 commit comments

Comments
 (0)