Increase the number of use cases file_size() works correctly, per JuhaSointusalo.

Juha had a good point in pull-request #1860, capture the bug fix before it gets lost in the sands of time.
This commit is contained in:
Rom Walton 2017-06-20 06:55:40 -07:00
parent 9d1972aba6
commit de26ed5674
1 changed files with 1 additions and 1 deletions

View File

@ -351,7 +351,7 @@ int boinc_delete_file(const char* path) {
//
int file_size(const char* path, double& size) {
#if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
HANDLE h = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
HANDLE h = CreateFileA(path, 0, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, 0, 0);
if (h == INVALID_HANDLE_VALUE) return ERR_STAT;
LARGE_INTEGER lisize;
if (GetFileSizeEx(h, &lisize)) {