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

XCZ Source File Deleted before decompressing on the same output folder as original #123

Closed
maxmag-soft opened this issue Oct 20, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@maxmag-soft
Copy link

maxmag-soft commented Oct 20, 2022

python3 /home/$USER/nsz/nsz.py -D '/media/censoredfolder/CENSOREDGAME[v0].xcz' -w --level 22 --verify --output /media/censoredfolder

             NSZ v4.1   ,;:;;,
                       ;;;;;
               .=',    ;:;;:,
              /_', "=. ';:;:;
              @=:__,  \,;:;:'
                _(\.=  ;:;;'
               `"_(  _/="`
                `"'

/media/censoredfolder/CENSOREDGAME[v0].xcz
Extract TitleID/Version: CENSOREDGAME[v0].xcz => 000censorednumber 0
Delete duplicate: /media/censoredfolder/CENSOREDGAME[v0].xcz
Error while decompressing file: /media/censoredfolder/CENSOREDGAME[v0].xcz
Traceback (most recent call last):
  File "/home/maxmag/nsz/nsz/__init__.py", line 245, in main
    decompress(filePath, outFolder)
  File "/home/maxmag/nsz/nsz/__init__.py", line 67, in decompress
    NszDecompress(filePath, outputDir, statusReportInfo)
  File "/home/maxmag/nsz/nsz/NszDecompressor.py", line 18, in decompress
    __decompressXcz(filePath, outputDir, True, False, statusReportInfo, pleaseNoPrint)
  File "/home/maxmag/nsz/nsz/NszDecompressor.py", line 218, in __decompressXcz
    fileHashes = FileExistingChecks.ExtractHashes(filePath)
  File "/home/maxmag/nsz/nsz/FileExistingChecks.py", line 14, in ExtractHashes
    container.open(str(gamePath), 'rb')
  File "/home/maxmag/nsz/nsz/Fs/Xci.py", line 283, in open
    r = super(Xci, self).open(path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "/home/maxmag/nsz/nsz/Fs/File.py", line 210, in open
    self.f = open(path, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/media/censoredfolder/CENSOREDGAME[v0].xcz'

Summary of errors which occurred while processing files:
Error while processing /media/censoredfolder/CENSOREDGAME[v0].xcz
Traceback (most recent call last):
  File "/home/maxmag/nsz/nsz/__init__.py", line 245, in main
    decompress(filePath, outFolder)
  File "/home/maxmag/nsz/nsz/__init__.py", line 67, in decompress
    NszDecompress(filePath, outputDir, statusReportInfo)
  File "/home/maxmag/nsz/nsz/NszDecompressor.py", line 18, in decompress
    __decompressXcz(filePath, outputDir, True, False, statusReportInfo, pleaseNoPrint)
  File "/home/maxmag/nsz/nsz/NszDecompressor.py", line 218, in __decompressXcz
    fileHashes = FileExistingChecks.ExtractHashes(filePath)
  File "/home/maxmag/nsz/nsz/FileExistingChecks.py", line 14, in ExtractHashes
    container.open(str(gamePath), 'rb')
  File "/home/maxmag/nsz/nsz/Fs/Xci.py", line 283, in open
    r = super(Xci, self).open(path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "/home/maxmag/nsz/nsz/Fs/File.py", line 210, in open
    self.f = open(path, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/media/censoredfolder/CENSOREDGAME[v0].xcz'


Done!

@nicoboss nicoboss self-assigned this Oct 20, 2022
@nicoboss nicoboss added the bug Something isn't working label Oct 20, 2022
@nicoboss
Copy link
Owner

What a stupid issue. I'm really sorry that this happened. I will soon look into this as this is quite a major logical flaw with the potential of data loss. Until this is fixed please don't use "-w", "--overwrite" or " --undupe" when decompressing to the same folder.

@maxmag-soft
Copy link
Author

Oh! , thank you for the reply, I posted in a hurry, and I was going to look in the source code sometime in the next week to search and post a solution.

I am loving this software, thanks for your work!

@nicoboss
Copy link
Owner

This is fixed now. As you can see in 127d0f4 the mistake was caused by accidentally specifying the wrong target file extensions when calling the FileExistingChecks::CreateTargetDict function. Sorry that this happened. This will fix will be in the NSZ v4.1.1 which should be released in the next few days.

@nicoboss
Copy link
Owner

nicoboss commented Dec 10, 2022

This issue should be fixed in the latest NSZ v4.2.0 release. Please let me know if you still experience this issue on the latest release.

@maxmag-soft
Copy link
Author

maxmag-soft commented Dec 11, 2022

I have aleary tried by getting the source code and ran, and the source file os not deleted anymore
This issue is fixed since 127d0f4
Thank you for you hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants