[nostalgia/tools] Revert writeFileBuff path to ox::String
This commit is contained in:
parent
4a0f6420b6
commit
21f40a8362
@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
#include "pack/pack.hpp"
|
#include "pack/pack.hpp"
|
||||||
|
|
||||||
static ox::Error writeFileBuff(const std::string_view path, ox::Vector<char> &buff) {
|
static ox::Error writeFileBuff(const ox::String &path, ox::Vector<char> &buff) {
|
||||||
try {
|
try {
|
||||||
std::ofstream f(path, std::ios::binary);
|
std::ofstream f(path.c_str(), std::ios::binary);
|
||||||
f.write(buff.data(), static_cast<intptr_t>(buff.size()));
|
f.write(buff.data(), static_cast<intptr_t>(buff.size()));
|
||||||
} catch (const std::fstream::failure&) {
|
} catch (const std::fstream::failure&) {
|
||||||
return OxError(2, "failed to write file");
|
return OxError(2, "failed to write file");
|
||||||
@ -45,7 +45,7 @@ static ox::Error run(const ox::ClArgs &args) {
|
|||||||
oxOutf("new size: {}\n", dstSize);
|
oxOutf("new size: {}\n", dstSize);
|
||||||
buff.resize(dstSize);
|
buff.resize(dstSize);
|
||||||
|
|
||||||
oxReturnError(writeFileBuff(argDst.c_str(), buff));
|
oxReturnError(writeFileBuff(argDst, buff));
|
||||||
return OxError(0);
|
return OxError(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ ox::Error copy(ox::PassThroughFS *src, ox::FileSystem32 *dest, ox::String path)
|
|||||||
oxOutf("copying directory: {}\n", path);
|
oxOutf("copying directory: {}\n", path);
|
||||||
ox::Vector<VerificationPair> verificationPairs;
|
ox::Vector<VerificationPair> verificationPairs;
|
||||||
// copy
|
// copy
|
||||||
oxReturnError(src->ls(path.c_str(), [&verificationPairs, src, dest, path](ox::String name, ox::InodeId_t) {
|
oxReturnError(src->ls(path.c_str(), [&verificationPairs, src, dest, path](const char *name, ox::InodeId_t) {
|
||||||
auto currentFile = path + name;
|
auto currentFile = path + name;
|
||||||
if (currentFile == "/.nostalgia") {
|
if (currentFile == "/.nostalgia") {
|
||||||
return OxError(0);
|
return OxError(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user