filesystem: Improve docs, make some promises about overwrites and file caches.

Note that SDL_FlushIO() doesn't make promises about file data sync but that
is intended to be changed in the IOStream code in a later commit.

Fixes #10886.
This commit is contained in:
Ryan C. Gordon
2024-09-26 19:25:34 -04:00
parent c1587b1eac
commit f267ec7681
4 changed files with 65 additions and 5 deletions

View File

@@ -121,7 +121,12 @@ bool SDL_SYS_CopyFile(const char *oldpath, const char *newpath)
SDL_CloseIO(input);
input = NULL;
if (!SDL_FlushIO(output)) {
goto done;
}
if (!SDL_CloseIO(output)) {
output = NULL; // it's gone, even if it failed.
goto done;
}
output = NULL;

View File

@@ -151,7 +151,7 @@ bool SDL_SYS_CopyFile(const char *oldpath, const char *newpath)
return false;
}
const BOOL rc = CopyFileW(woldpath, wnewpath, TRUE);
const BOOL rc = CopyFileExW(woldpath, wnewpath, NULL, NULL, NULL, COPY_FILE_ALLOW_DECRYPTED_DESTINATION|COPY_FILE_NO_BUFFERING);
SDL_free(wnewpath);
SDL_free(woldpath);
if (!rc) {