Homebrew RELEASE Legal NSP splitter for FAT32

Chocola

GBAtemp Meowgular
Member
Joined
Sep 18, 2018
Messages
379
Trophies
0
Age
32
Location
Neko Paradise
XP
723
Country
Korea, South
If the filename use spaces then use quotes surrounding the filename, example:

py splitNSP.py "File with space on his name.nsp"

If it not work you can remove the spaces renaming the nsp.
 
  • Like
Reactions: HiD

NANASHI89

Well-Known Member
Member
Joined
May 3, 2012
Messages
2,473
Trophies
1
XP
5,358
Country
United States
If the filename use spaces then use quotes surrounding the filename, example:

py splitNSP.py "File with space on his name.nsp"

If it not work you can remove the spaces renaming the nsp.



========== NSP Splitter ==========
Traceback (most recent call last):
File "C:\Users\***\splitNSP.py", line 143, in <module>
main()
File "C:\Users\***\splitNSP.py", line 140, in main
splitCopy(filepath)
File "C:\Users\***\splitNSP.py", line 79, in splitCopy
info = shutil.disk_usage(os.path.dirname(filepath))
File "C:\Users\***\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 1028, in disk_usage
total, free = nt._getdiskusage(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified
 

Chocola

GBAtemp Meowgular
Member
Joined
Sep 18, 2018
Messages
379
Trophies
0
Age
32
Location
Neko Paradise
XP
723
Country
Korea, South
========== NSP Splitter ==========
Traceback (most recent call last):
File "C:\Users\***\splitNSP.py", line 143, in <module>
main()
File "C:\Users\***\splitNSP.py", line 140, in main
splitCopy(filepath)
File "C:\Users\***\splitNSP.py", line 79, in splitCopy
info = shutil.disk_usage(os.path.dirname(filepath))
File "C:\Users\***\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 1028, in disk_usage
total, free = nt._getdiskusage(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified

Seems that script aren't ready to allow spaces on the file paths:

  1. Create a folder on C:// called nsps, then move the python script and the nsp file to this folder
  2. Rename the nsp file, sustitute spaces with another character, _ for example
  3. Open cmd and run: cd C://nsps
  4. Then run the script: py splitNSP.py my_nsp_file.nsp
I'm not the author of this tool, the paths with spaces should be fixed by him
 
Last edited by Chocola,

nickchase5146

New Member
Newbie
Joined
Sep 24, 2018
Messages
1
Trophies
0
Age
35
XP
61
Country
United States
Seems that script aren't ready to allow spaces on the file paths:

  1. Create a folder on C:// called nsps, then move the python script and the nsp file to this folder
  2. Rename the nsp file, sustitute spaces with another character, _ for example
  3. Open cmd and run: cd C://nsps
  4. Then run the script: py splitNSP.py my_nsp_file.nsp
I'm not the author of this tool, the paths with spaces should be fixed by him

Tried moving the script and nsp file to the c drive in a path without spaces as well as changed the nsp filename to match, but I still get the same error.
 

Chocola

GBAtemp Meowgular
Member
Joined
Sep 18, 2018
Messages
379
Trophies
0
Age
32
Location
Neko Paradise
XP
723
Country
Korea, South

bluedart

Well-Known Member
Member
Joined
Nov 13, 2016
Messages
270
Trophies
0
XP
2,221
Country
United States
I can see there's actually a similar error being reported, but let me throw my documented error on here anyway so we can try and debug it. So I downloaded python 3.7 and installed it, then since it didn't modify my path variable I just manually call the full path of python 3.7. Here's what happens:
python_problem.jpg


Any ideas?

Edit: I'm on Windows 7 if that matters. The homebrew directory is on a 1TB usb drive that I've used for the past few years.
 
Last edited by bluedart,

DocKlokMan

Plugin Dev
OP
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
I can see there's actually a similar error being reported, but let me throw my documented error on here anyway so we can try and debug it. So I downloaded python 3.7 and installed it, then since it didn't modify my path variable I just manually call the full path of python 3.7. Here's what happens:
View attachment 146012

Any ideas?

Edit: I'm on Windows 7 if that matters. The homebrew directory is on a 1TB usb drive that I've used for the past few years.
Can you try using the full path to the NSP? I didn't test it on Windows but the command should be available for both Unix and Windows. if it works when you provide the full path then I'll know what's wrong and can put up a revised version.

EDIT: Try the latest version v1.0.1 and let me know if the issue is resolved.
 
Last edited by DocKlokMan,

Brandon Golway

Member
Newcomer
Joined
Feb 15, 2015
Messages
24
Trophies
0
Age
38
XP
109
Country
United States
I can't get the switch to recognize the resulting folder. It splits the NSP successfully and the archive bits are set on the split files, but when I copy the folder to the /tinfoil/nsp folder and then open tinfoil it sees nothing in the nsp folder
 
Last edited by Brandon Golway,

bluedart

Well-Known Member
Member
Joined
Nov 13, 2016
Messages
270
Trophies
0
XP
2,221
Country
United States
Using full quoted filenames for all of them got it to start properly, as it's saying that it's "calculating number of splits..." and "splitting NSP into 3 parts...". It'll probably be a while, but I think I'm on the right track. Did not try the newest revision, was the absolute path bit all you changed?

Edit: Program finished with "NSP successfully split!" Quick question however: When you say "change the archive bit" does opening the folder properties with Alt+Enter, clicking "Advanced" and then ticking the "Folder is ready for archiving" option achieve what you are aiming for? Also, when it prompts me to apply that to the files under said directory should I do so or leave the flag unchanged for them?
 
Last edited by bluedart, , Reason: Addition

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,793
Trophies
1
Age
44
XP
6,550
Country
Germany
Fantastic tool, thank you very much!

When you say "change the archive bit" does opening the folder properties with Alt+Enter, clicking "Advanced" and then ticking the "Folder is ready for archiving" option achieve what you are aiming for? Also, when it prompts me to apply that to the files under said directory should I do so or leave the flag unchanged for them?
I was wondering the same.
 

Mysuke

Well-Known Member
Newcomer
Joined
Mar 9, 2017
Messages
86
Trophies
0
Age
24
XP
331
Country
Brazil
Tested the 1.0.1 version with Just Dance 2017 and works great, i just dragged and dropped the .nsp above the .py file and enabled archiving in the folder's properties it created.

Installed with Tinfoil 15fcd94 (latest build from lavatech right now) and the game is playing fine, i also checked for corruption from system settings and it showed no errors.

Thanks for releasing this!

Edit: Program finished with "NSP successfully split!" Quick question however: When you say "change the archive bit" does opening the folder properties with Alt+Enter, clicking "Advanced" and then ticking the "Folder is ready for archiving" option achieve what you are aiming for? Also, when it prompts me to apply that to the files under said directory should I do so or leave the flag unchanged for them?

I used the second option to apply to the folder, sub-folders and files as well, worked fine here.
 

DocKlokMan

Plugin Dev
OP
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
Using full quoted filenames for all of them got it to start properly, as it's saying that it's "calculating number of splits..." and "splitting NSP into 3 parts...". It'll probably be a while, but I think I'm on the right track. Did not try the newest revision, was the absolute path bit all you changed?

Edit: Program finished with "NSP successfully split!" Quick question however: When you say "change the archive bit" does opening the folder properties with Alt+Enter, clicking "Advanced" and then ticking the "Folder is ready for archiving" option achieve what you are aiming for? Also, when it prompts me to apply that to the files under said directory should I do so or leave the flag unchanged for them?
Correct, that is what setting the archive flag on the folder means. Only the folder needs the flag, files inside don't need it.

are they supposed to be called 00, 01 etc with no file extension?
Yes.

Fantastic tool, thank you very much!


I was wondering the same.
See above.
 

DocKlokMan

Plugin Dev
OP
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
Any reason why this isn't done by the script itself?
Yes. Setting the archive flag needs admin privileges (meaning you'd need to run the script as admin) plus there's no one python command that sets the archive flag on both Windows and Unix (it would need to detect which you are using and import / use different functions for each) and lastly, on some OS's like macOS even if you set the archive flag on the folder the flag is erased when copied to a FAT32 partition. I don't feel like adding a feature that only works on some operating systems and not others.
 

Brandon Golway

Member
Newcomer
Joined
Feb 15, 2015
Messages
24
Trophies
0
Age
38
XP
109
Country
United States
Last edited by Brandon Golway,
  • Like
Reactions: lordelan

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: I did use a bot for Diablo III though but no ban there lol