sa3paleasm / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
0 stars 0 forks source link

Yet another problem with sparse flags #736

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Now that I have Windows 7, I can test these issues personally.

This happens with both 0.16.x and 1.0.x (latest from svn).

All files downloaded and completed still have the sparse flag set.

Until now I hadn't noticed a problem with that. However a user of Windows 8-8.1 
discovered that the sparse flag interferes with Windows 8's native utility of 
mounting ISOs. As soon as he copied the iso somewhere else (which removes the 
sparse flag) he was able to mount the copied iso.

Original issue reported on code.google.com by hammered...@gmail.com on 11 Apr 2015 at 10:10

GoogleCodeExporter commented 8 years ago
The sparse flag is supposed to be cleared in file::close(). On windows what it 
does is to check if the file actually is sparse (stat the file and compare is 
size to the size of the first file extent). If it is, and the file was opened 
in write mode and sparse mode (checking the sparse mode here may be a bit too 
strict). Then it attempts to clear the sparse flag (using DeviceIoControl).

could you verify it makes it to DeviceIoControl at all? and if not, which 
condition is failing, preventing it?

Original comment by arvid.no...@gmail.com on 11 Apr 2015 at 12:28

GoogleCodeExporter commented 8 years ago
>could you verify it makes it to DeviceIoControl at all? and if not, which 
condition is failing, preventing it?

Sure. How do I do that? Through a debugger? Setting a break point where?

Original comment by hammered...@gmail.com on 11 Apr 2015 at 1:16

GoogleCodeExporter commented 8 years ago
yeah, in file::close() in src/file.cpp

Original comment by arvid.no...@gmail.com on 11 Apr 2015 at 2:15