Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failed to open file for writing" #100

Open
ChtPlayer opened this issue Nov 23, 2022 · 4 comments
Open

"Failed to open file for writing" #100

ChtPlayer opened this issue Nov 23, 2022 · 4 comments

Comments

@ChtPlayer
Copy link

Hi, i'm trying to backup saves from a broken nand with a bad "System" partition and getting the error mentioned on the title, only happens with games that have folders in their saves like BotW or n64 NSO, i'm guessing it is trying to create a folder named "/" and windows wont let it do that. debug does not seem to indicate anything useful (maybe i'm just blind).

Captura de pantalla 2022-11-23 112604

@gregoo
Copy link

gregoo commented Dec 8, 2022

@ChtPlayer I stumbled upon the same issue with Smash Bros.

image

I thought it was the double slash as well but upon reading the QFile doc, it seem this one will fail if the path to the file does not completely exists.

In the code it assumes that all files in a save are not nested, and thus does not try to create the nested dirs before extracting, which fails.

With the dir creation beforehand I'm managing to have a complete extraction.

image

As with the original 5.2 release, even though it asks for an folder before extracting, everything is put directly in C:\ on my computer. I did not try to fix that as it is a minor inconvenience and I am in no way a C++ developper.

image

I've create a release on my fork, based on the current master branch, with an extra commit.
https://github.com/gregoo/NxNandManager/releases/tag/master-20221208%2Bextractfs

You will need to bring in the res\hactoolnet.exe file from the official release for everything to work.

Hoping this will help you.

@gregoo
Copy link

gregoo commented Dec 8, 2022

One of my save isn't working for some reason so your mileage may vary. I don't have a Windows dev environment on hand so I can't really test much more than what I did.

image

@blakehan
Copy link

blakehan commented Aug 6, 2023

@ChtPlayer I stumbled upon the same issue with Smash Bros.

image

I thought it was the double slash as well but upon reading the QFile doc, it seem this one will fail if the path to the file does not completely exists.

In the code it assumes that all files in a save are not nested, and thus does not try to create the nested dirs before extracting, which fails.

With the dir creation beforehand I'm managing to have a complete extraction.

image

As with the original 5.2 release, even though it asks for an folder before extracting, everything is put directly in C:\ on my computer. I did not try to fix that as it is a minor inconvenience and I am in no way a C++ developper.

image

I've create a release on my fork, based on the current master branch, with an extra commit. https://github.com/gregoo/NxNandManager/releases/tag/master-20221208%2Bextractfs

You will need to bring in the res\hactoolnet.exe file from the official release for everything to work.

Hoping this will help you.

Cannot create folder if there are Japaness characters in the game name. Can you modify the code and just leave the title ID in the path?

@blakehan
Copy link

blakehan commented Aug 6, 2023

@ChtPlayer I stumbled upon the same issue with Smash Bros.
image
I thought it was the double slash as well but upon reading the QFile doc, it seem this one will fail if the path to the file does not completely exists.
In the code it assumes that all files in a save are not nested, and thus does not try to create the nested dirs before extracting, which fails.
With the dir creation beforehand I'm managing to have a complete extraction.
image
As with the original 5.2 release, even though it asks for an folder before extracting, everything is put directly in C:\ on my computer. I did not try to fix that as it is a minor inconvenience and I am in no way a C++ developper.
image
I've create a release on my fork, based on the current master branch, with an extra commit. https://github.com/gregoo/NxNandManager/releases/tag/master-20221208%2Bextractfs
You will need to bring in the res\hactoolnet.exe file from the official release for everything to work.
Hoping this will help you.

Cannot create folder if there are Japaness characters in the game name. Can you modify the code and just leave the title ID in the path?

I think it's simply comment these two lines, but I don't have a windows dev machine to build the project... :(

        if (file->hasAdditionalString("title_name"))
            path.append(" " + QString::fromStdString(file->normalizedTitleLabel()));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants