| File src/utils/fs.c changed (mode: 100644) (index d079d6aca..c669f341b) |
| ... |
... |
is_dir_writable(const char path[]) |
| 413 |
413 |
if(ret == ERROR_NOT_SUPPORTED || ret == ERROR_INVALID_FUNCTION || |
if(ret == ERROR_NOT_SUPPORTED || ret == ERROR_INVALID_FUNCTION || |
| 414 |
414 |
ret == ERROR_CALL_NOT_IMPLEMENTED) |
ret == ERROR_CALL_NOT_IMPLEMENTED) |
| 415 |
415 |
{ |
{ |
| 416 |
|
wchar_t *utf16_path_fb = utf8_to_utf16(path); |
|
| 417 |
|
if(utf16_path_fb == NULL) |
|
| 418 |
|
{ |
|
| 419 |
|
return 0; |
|
| 420 |
|
} |
|
| 421 |
|
const DWORD attrs = GetFileAttributesW(utf16_path_fb); |
|
| 422 |
|
free(utf16_path_fb); |
|
| 423 |
|
return attrs != INVALID_FILE_ATTRIBUTES && |
|
| 424 |
|
(attrs & FILE_ATTRIBUTE_DIRECTORY); |
|
|
416 |
|
/* Another potential option to consider is trying to open directory for |
|
417 |
|
* writing, like was done prior to the ACL checks. However, it may have |
|
418 |
|
* problems, so it needs testing in environment where querying ACLs |
|
419 |
|
* fails. */ |
|
420 |
|
return is_dir(path); |
| 425 |
421 |
} |
} |
| 426 |
422 |
return 0; |
return 0; |
| 427 |
423 |
} |
} |