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

pk3ds incorrectly throwing "Folder does not contain an 'a' folder in the top level" on ext4 filesystems #511

Open
ImperatorStorm opened this issue Nov 28, 2021 · 7 comments

Comments

@ImperatorStorm
Copy link

ImperatorStorm commented Nov 28, 2021

pk3ds is incorrectly throwing "Folder does not contain an 'a' folder in the top level" despite the dump folder meeting requirements.
running via mono

$ tree -a .

@kwsch
Copy link
Owner

kwsch commented Nov 28, 2021

The program also checks the count of files in the folders; are you sure you have dumped all the files for the game you are trying to load?

@ImperatorStorm
Copy link
Author

Assuming https://github.com/Asia81/HackingToolkit9DS-Deprecated- worked correctly, yes.

@kwsch
Copy link
Owner

kwsch commented Nov 28, 2021

Valid file counts within the a* folders:

private const int FILECOUNT_XY = 271;
private const int FILECOUNT_ORASDEMO = 301;
private const int FILECOUNT_ORAS = 299;
private const int FILECOUNT_SMDEMO = 239;
private const int FILECOUNT_SM = 311;
private const int FILECOUNT_USUM = 333;

@ImperatorStorm
Copy link
Author

i've got exactly 299 files in a

@kwsch
Copy link
Owner

kwsch commented Nov 28, 2021

Here's the logic that checks for the existence of the a folder:

pk3DS/pk3DS/Main.cs

Lines 504 to 528 in dfdbce7

private bool CheckIfRomFS(string path)
{
string[] top = Directory.GetDirectories(path);
FileInfo fi = new FileInfo(top[top.Length > 1 ? 1 : 0]);
// Check to see if the folder is romfs
if (fi.Name == "a")
{
string[] files = Directory.GetFiles(path, "*", SearchOption.AllDirectories);
var cfg = CheckGameType(files);
if (cfg == null)
{
RomFSPath = null;
Config = null;
WinFormsUtil.Error("File count does not match expected game count.", "Files: " + files.Length);
return false;
}
RomFSPath = path;
Config = cfg;
return true;
}
WinFormsUtil.Error("Folder does not contain an 'a' folder in the top level.");
RomFSPath = null;
return false;

Not sure what all you have in there, but it's expecting the first directory in the folder to be called a exactly. If there's two, then it checks the second (order unk)

@ImperatorStorm
Copy link
Author

first folder is indeed exactly a.

@ImperatorStorm
Copy link
Author

ImperatorStorm commented Nov 29, 2021

Retrying on Windows worked perfectly, somehow
I'm gonna guess pk3DS doesn't like ext4 filesystems for some wierd reason

@ImperatorStorm ImperatorStorm changed the title pk3ds incorrectly throwing "Folder does not contain an 'a' folder in the top level" pk3ds incorrectly throwing "Folder does not contain an 'a' folder in the top level" on ext-4 filesystems Nov 29, 2021
@ImperatorStorm ImperatorStorm changed the title pk3ds incorrectly throwing "Folder does not contain an 'a' folder in the top level" on ext-4 filesystems pk3ds incorrectly throwing "Folder does not contain an 'a' folder in the top level" on ext4 filesystems Nov 29, 2021
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