forked from premiere/premiere-libtorrent
use SetFileValidData() on non-sparse files on windows
This commit is contained in:
parent
dc4d50b117
commit
7c2d2f6d12
|
@ -747,6 +747,13 @@ namespace libtorrent
|
||||||
ec = error_code(GetLastError(), get_system_category());
|
ec = error_code(GetLastError(), get_system_category());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ((mode & sparse) == 0)
|
||||||
|
{
|
||||||
|
// if the user has permissions, avoid filling
|
||||||
|
// the file with zeroes, but just fill it with
|
||||||
|
// garbage instead
|
||||||
|
SetFileValidData(m_file_handle, offs.QuadPart);
|
||||||
|
}
|
||||||
if (::SetEndOfFile(m_file_handle) == FALSE)
|
if (::SetEndOfFile(m_file_handle) == FALSE)
|
||||||
{
|
{
|
||||||
ec = error_code(GetLastError(), get_system_category());
|
ec = error_code(GetLastError(), get_system_category());
|
||||||
|
|
Loading…
Reference in New Issue