Skip to content

add some customized tempfile code#294

Merged
mostynb merged 1 commit into
buchgr:masterfrom
mostynb:tempfile_util
Jun 18, 2020
Merged

add some customized tempfile code#294
mostynb merged 1 commit into
buchgr:masterfrom
mostynb:tempfile_util

Conversation

@mostynb

@mostynb mostynb commented Jun 18, 2020

Copy link
Copy Markdown
Collaborator

We are discussing allowing concurrent uploads for the same blob in #267.

Part of the proposed new design involves using pseudo-randomly named temp files. Unfortunately, ioutil.TempFile creates files with more restrictive permissions than we want- 0600 before umask, whereas we want 0666 before umask.

This code is an adapted version of the algorithm in ioutil.TempFile, refactored for our more narrow use case- in particular we skip the use of the pid in the seed, since our use case is single-process, and we don't bother re-seeding if we encounter lots of collisions (which is unlikely).

(We do not use this code, yet.)

We are discussing allowing concurrent uploads for the same blob in buchgr#267.

Part of the proposed new design involves using pseudo-randomly named
temp files. Unfortunately, ioutil.TempFile creates files with more
restrictive permissions than we want- 0600 before umask, whereas we
want 0666 before umask.

This code is an adapted version of the algorithm in ioutil.TempFile,
refactored for our more narrow use case- in particular we skip the
use of the pid in the seed, since our use case is single-process,
and we don't bother re-seeding if we encounter lots of collisions
(which is unlikely).

(We do not use this code, yet.)
@mostynb mostynb merged commit b261f40 into buchgr:master Jun 18, 2020
@mostynb mostynb deleted the tempfile_util branch June 18, 2020 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant