jlouis / etorrent

Erlang Bittorrent Client
BSD 2-Clause "Simplified" License
295 stars 50 forks source link

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

Open jameschurchman opened 13 years ago

jameschurchman commented 13 years ago

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 commented 13 years ago

There are actually two separate issues here:

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?