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

Repacking a folder containing an extracted NSP using --create results in a "Is a directory" error #140

Open
DarkCTO opened this issue Oct 7, 2023 · 4 comments

Comments

@DarkCTO
Copy link

DarkCTO commented Oct 7, 2023

I have a game I extracted with -x
But if I compress -c the same folder it gives me "Is a directory" error.

And I end up with 97Kb nsp file.
Could you fix this?

@DarkCTO
Copy link
Author

DarkCTO commented Oct 7, 2023

I just need to do
nsz -c "a folder that contains subfolder"

and folder structure is preserved.

@nicoboss nicoboss changed the title Compress after extraction is not the same! Repacking a folder of an NSP extracted using --extract results in a "Is a directory" error Oct 16, 2023
@nicoboss nicoboss changed the title Repacking a folder of an NSP extracted using --extract results in a "Is a directory" error Repacking a folder containing an extracted NSP results in a "Is a directory" error Oct 16, 2023
@nicoboss nicoboss changed the title Repacking a folder containing an extracted NSP results in a "Is a directory" error Repacking a folder containing an extracted NSP using --create results in a "Is a directory" error Oct 16, 2023
@nicoboss
Copy link
Owner

nicoboss commented Oct 16, 2023

I have a game I extracted with -x But if I compress -c the same folder it gives me "Is a directory" error.

And I end up with 97Kb nsp file. Could you fix this?

I think you are misunderstanding the command line options. --extract just extracts the content of an NSP while --create converts a folder containing an extracted NSP back to an NSP. This has nothing to do with compression at all and are options nobody beside a few game modders are using. Regardless of why you originally encountered this issue I will test and make sure --extract and --create are working but it's highly unlikely that you or any other normal user will ever need them.

To compress an NSP to an NSZ use nsz -C YourGame.nsp - note the capital C instead of the lower-case c. No need to extract your game before compressing it. Extracting, decrypting, compressing and repacking is all done completely automatically during compression and the reverse is performed during decompression. It even does so that the file before compression and the one obtained after decompression are bit identical for the sage of game preservation.

@DarkCTO
Copy link
Author

DarkCTO commented Oct 17, 2023

Yeah my bad, I didn't mean compression with -c
Just that --create and --extract could be opposite of each other (reversible) and --create could be supporting directories with subfolders.

@nicoboss
Copy link
Owner

nicoboss commented Oct 17, 2023

--extract and --create should be the opposite of each other but those options are barely tested as almost nobody is using them. I will investigate and make sure they work as intended.

I did some research and NSP files do not support subdirectories as far I'm aware. All files are stored under the root level. How do you expect a folder containing sub-directories to be added to an NSP? Do you want me to recursively add all the files in all the sub folders to the root of the NSP? There might be a way to store folders in an XCI but --create currently only supports NSP files.

Maybe explain why you need --extract and --create because I can think of almost no use-case where those options are useful beside game modding.

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

2 participants