mirror of
https://github.com/mmozeiko/pkg2zip.git
synced 2026-09-03 03:29:59 +03:00
no need to create temporary zip anymore, name is known at beginning
This commit is contained in:
@@ -75,19 +75,6 @@ void sys_write(sys_file file, uint64_t offset, const void* buffer, uint32_t size
|
||||
}
|
||||
}
|
||||
|
||||
void sys_rename(const char* src, const char* dst)
|
||||
{
|
||||
WCHAR wsrc[MAX_PATH];
|
||||
WCHAR wdst[MAX_PATH];
|
||||
MultiByteToWideChar(CP_UTF8, 0, src, -1, wsrc, MAX_PATH);
|
||||
MultiByteToWideChar(CP_UTF8, 0, dst, -1, wdst, MAX_PATH);
|
||||
|
||||
if (!MoveFileExW(wsrc, wdst, MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING))
|
||||
{
|
||||
fatal("ERROR: failed to rename '%s' to '%s'\n", src, dst);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
@@ -151,12 +138,4 @@ void sys_write(sys_file file, uint64_t offset, const void* buffer, uint32_t size
|
||||
}
|
||||
}
|
||||
|
||||
void sys_rename(const char* src, const char* dst)
|
||||
{
|
||||
if (rename(src, dst) != 0)
|
||||
{
|
||||
fatal("ERROR: failed to rename '%s' to '%s'\n", src, dst);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user