Extract ROM to new folder next to archive

For example if DS_ROMS.zip had game.nds, the directory structure would be:
├── DS_ROMS
│   └── game.nds
└── DS_ROMS.zip
This commit is contained in:
WaluigiWare64 2020-12-19 17:41:51 +00:00 committed by GitHub
parent 8d70d0926c
commit d6cade25f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -87,8 +87,9 @@ QVector<QString> ExtractFileFromArchive(const char* path, const char* wantedFile
return QVector<QString> {"Err", archive_error_string(a)};
}
const char* fileToWrite = archive_entry_pathname(entry);
std::ofstream(fileToWrite, std::ofstream::binary).write((char*)archiveBuffer.get(), bytesToWrite);
QString fileToWrite = QFileInfo(path).absolutePath() + "/" + QFileInfo(dirToWrite).baseName() + "/" + archive_entry_pathname(entry);
std::ofstream(fileToWrite.toUtf8().constData(), std::ofstream::binary).write((char*)archiveBuffer.get(), bytesToWrite);
archiveBuffer.reset(nullptr);
archive_read_close(a);