-
Notifications
You must be signed in to change notification settings - Fork 7
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
Do not use the system's tmp dir #56
Do not use the system's tmp dir #56
Conversation
Renaming a file does not work across filesystems. co-authored-by: Issac Kelly <[email protected]>
I think it might be worth making this a configuration option. I think the reason for not using the system temp directory is that it might not be on the same filesystem as the data directory and thus atomic renames may not work (correct me if I'm wrong there). I think this is a good argument for not defaulting to the system temp directory. However, if - like me - you want to run this on your primary desktop and your system temp directory is on the same filesystem as the data directory then the temp directory has the really nice feature of cleaning itself up on every reboot and so if the sync server crashes and leaves data hanging around it will not persist beyond the next boot. |
Extrapolating from there, actually the user could already override the I'm closing this. |
Alex, you're right about the need, and I don't really care that it's a config option or not. |
@issackelly I agree, although I don't care too much about defaulting to |
Not sure if this is okay? |
I think the only thing remaining is to add some brief documentation to the |
5e132db
to
c78738e
Compare
c78738e
to
51dae34
Compare
Docs added. |
/// | ||
/// This will attempt to create the tmpdir directory and throw an error if | ||
/// it does not exist. | ||
pub fn with_tmpdir<P: AsRef<Path>>(self, tmpdir: P) -> Option<Result<Self, std::io::Error>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this return type intuitive? None
is only returned when we can't take ownership of the inner FsStore
...
(split out from #48)
/cc @issackelly