Re: [PATCH v11 0/1] MR8778: sane.ds: Adding a window for loading and saving the scanner configuration
18 Aug
2025
18 Aug
'25
9:54 p.m.
Esme Povirk (@madewokherd) commented about dlls/sane.ds/cfg.c:
+ } + *last_slash = L'\0'; + attr = GetFileAttributesW(path); + if (attr == INVALID_FILE_ATTRIBUTES) + { + if (!CreateDirectoryW(path, NULL)) + { + DWORD err = GetLastError(); + ERR("CreateDirectoryW returned error: %lu\n", err); + return FALSE; + } + } + return TRUE; +} + +BOOL is_exist_file(WCHAR* path) I would suggest simply trying to create the file you will use when it's time to use it and handling any errors that come up. Checking first can cause race conditions: https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/8778#note_113132
199
Age (days ago)
199
Last active (days ago)
0 comments
1 participants
participants (1)
-
Esme Povirk (@madewokherd)