mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-05-02 22:36:37 +08:00
Attempt to fix overwriting files when pasting.
This commit is contained in:
parent
f0119190b4
commit
352fc5389a
@ -80,10 +80,8 @@ static void action_paste_files_update(ui_view* view, void* data, float* progress
|
|||||||
} else {
|
} else {
|
||||||
Handle srcFileHandle;
|
Handle srcFileHandle;
|
||||||
if(R_SUCCEEDED(res = FSUSER_OpenFile(&srcFileHandle, *srcArchive, srcFsPath, FS_OPEN_READ, 0))) {
|
if(R_SUCCEEDED(res = FSUSER_OpenFile(&srcFileHandle, *srcArchive, srcFsPath, FS_OPEN_READ, 0))) {
|
||||||
u64 size = 0;
|
|
||||||
if(R_SUCCEEDED(res = FSFILE_GetSize(srcFileHandle, &size)) && R_SUCCEEDED(res = FSUSER_CreateFile(*dstArchive, dstFsPath, 0, size))) {
|
|
||||||
Handle dstFileHandle;
|
Handle dstFileHandle;
|
||||||
if(R_SUCCEEDED(res = FSUSER_OpenFile(&dstFileHandle, *dstArchive, dstFsPath, FS_OPEN_WRITE, 0))) {
|
if(R_SUCCEEDED(res = FSUSER_OpenFile(&dstFileHandle, *dstArchive, dstFsPath, FS_OPEN_WRITE | FS_OPEN_CREATE, 0))) {
|
||||||
u32 bytesRead = 0;
|
u32 bytesRead = 0;
|
||||||
u32 offset = 0;
|
u32 offset = 0;
|
||||||
u8* buffer = (u8*) calloc(1, 1024 * 512);
|
u8* buffer = (u8*) calloc(1, 1024 * 512);
|
||||||
@ -104,7 +102,6 @@ static void action_paste_files_update(ui_view* view, void* data, float* progress
|
|||||||
res = FSUSER_ControlArchive(*dstArchive, ARCHIVE_ACTION_COMMIT_SAVE_DATA, NULL, 0, NULL, 0);
|
res = FSUSER_ControlArchive(*dstArchive, ARCHIVE_ACTION_COMMIT_SAVE_DATA, NULL, 0, NULL, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FSFILE_Close(srcFileHandle);
|
FSFILE_Close(srcFileHandle);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user