does this work?

also add a crude diagnosis tool for #1825
This commit is contained in:
tildearrow 2025-09-28 18:26:10 -05:00
parent 52d494c601
commit 0f7e1a50c9
5 changed files with 330 additions and 258 deletions

View file

@ -50,6 +50,27 @@ bool moveFiles(const char* src, const char* dest) {
#endif
}
bool copyFiles(const char* src, const char* dest) {
FILE* f=ps_fopen(src,"rb");
if (f==NULL) return false;
FILE* of=ps_fopen(dest,"wb");
if (of==NULL) {
fclose(f);
return false;
}
char block[2048];
while (!feof(f)) {
size_t readTotal=fread(block,1,2048,f);
if (readTotal) fwrite(block,1,readTotal,of);
}
fclose(of);
fclose(f);
return true;
}
bool deleteFile(const char* path) {
#ifdef _WIN32
return DeleteFileW(utf8To16(path).c_str());