婆罗门
精华
|
战斗力 鹅
|
回帖 0
注册时间 2007-3-6
|
本帖最后由 downforce 于 2017-8-7 22:27 编辑
prealloc pre-allocates file space before download begins. This may take some time depending on the size of the file.
If you are using newer file systems such as ext4 (with extents support), btrfs, xfs or NTFS(MinGW build only), falloc is your best choice. It allocates large(few GiB) files almost instantly. Don't use falloc with legacy file systems such as ext3 and FAT32 because it takes almost same time as prealloc and it blocks aria2 entirely until allocation finishes. falloc may not be available if your system doesn't have posix_fallocate(3) function.
trunc uses ftruncate(2) system call or platform-specific counterpart to truncate a file to a specified length.
要使用MinGW编译的aria2和支持extents的ext4才建议用falloc。
另外:trunc可能根本没用。
Using trunc seemingly allocates disk space very quickly, but what it actually does is that it sets file length metadata in file system, and does not allocate disk space at all. This means that it does not help avoiding fragmentation.
|
|