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

Detect OS and fallback to preallocation_strategy : preallocate if wise #112

Open
jameschurchman opened this issue Aug 15, 2011 · 1 comment

Comments

@jameschurchman
Copy link

preallocation_strategy set to "sparse" has problems on FreeBSD / OS X

A beter default would be a {preallocation_strategy,best_guess} where it OS detects ( or file system detects if thats the cause of the issues) and choses the appropriate strategy. A user can still manually override if the wish.

@jlouis
Copy link
Owner

jlouis commented Aug 23, 2011

There are actually two separate issues here:

  • What happens when you write/seek off the end of the file?
  • Can the filesystem efficiently handle sparse files?

These two issues are actually orthogonal. The first one MUST use a preallocation strategy, but the second SHOULD use a preallocation strategy. A good bet is to make a check for the operating system first and then for the file system in question. Doing it in that order should solve most of these kinds of problems.

On the other hand, how do you reliably query for this information?

@ghost ghost assigned jlouis Oct 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants