Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Pre-allocation is a lie! #10282
On Windows, if the user does not have the required permissions, file pre-allocation will fail. It will pretend it worked, but what you get is just a sparse file. You may not notice the resulting fragmentation if you are using SSD, but switch to a HDD and download a torrent with more than one file and you will see your disk crying for help.
I believe no body noticed it yet because most Windows users always use admin accounts. The fact that Windows explorer shows a make believe file size for sparse files does not help. Only if the (non-admin) user clicks on properties he will see the actual allocated size.
This is not qBittorrent problem (well, kind of is), but a libTorrent problem. I already tried warn them there
I hope that issue will be reopened, but the final solution may require some little tweaks on qBittorrent too. AFTER libTorrent fixes the problem, I vote for a simple permission check and a message box warning the user that due to lack of permissions, pre-allocation will take a little longer for him (because Windows will fill the allocated space with zeros). No UAC, no nothing.
Guys, I talked to the libTorrent guys, did a couple more tests using libTorrent 1.2 and I can confirm libTorrent is working as expected, as you can see here:
It seems to be a qBittorrent only problem. So, here is I can reproduce the problem:
When the download starts, this is what the Windows Explorer file properties dialog show:
I can confirm "file pre allocation" fails... on W10/64... i'm in use to flag always this config, but, after seeing it's not working, i deflagged it... flagging it, file are not allocated, it's as config is not set, files are loaded seconds by seconds when torrent get it, NOT BEFORE as it should be.