parent
52d494c601
commit
0f7e1a50c9
5 changed files with 330 additions and 258 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue