Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some customized tempfile code #294

Merged
merged 1 commit into from
Jun 18, 2020
Merged

Conversation

mostynb
Copy link
Collaborator

@mostynb mostynb commented Jun 18, 2020

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