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

[Feature Request]: Increase file path character limit for game folder detection #12368

Open
jklphe00 opened this issue Feb 28, 2025 · 6 comments · May be fixed by #12370
Open

[Feature Request]: Increase file path character limit for game folder detection #12368

jklphe00 opened this issue Feb 28, 2025 · 6 comments · May be fixed by #12370
Labels
Enhancement / Feature Request FR: Awaiting Consideration The feature request is awaiting a team members consideration.

Comments

@jklphe00
Copy link

jklphe00 commented Feb 28, 2025

Description

I tried a few searches to see if this has been requested yet, but didn't find anything yet.

I noticed that the file path character limit for game detection is around 218 characters or so. Any higher and those games wouldn't be detected in the scan. Could the limit be increased? This is the only emulator I've used that has a file path limit this low.

Reason

Having this limit increased would allow me to keep my folder names and file names for the disc images without renaming them.

Examples

This issue comes up for me because I use some undub or translation patches for some games and I keep the readme files inside a folder for those games.

Here are some examples:

D:\Emulation\Sony - PlayStation 2\PS2 Discs\Dragon Quest V - The Heavenly Bride (Japan) [T-En by DQ Translations v1.2] (DQ~1\Dragon Quest V - The Heavenly Bride (Japan) [T-En by DQ Translations v1.2] (DQ Style) [n].chd
D:\Emulation\Sony - PlayStation 2\PS2 Discs\Project Zero (Europe) (En,Fr,De,Es,It) [Undub by karas84 v1.3.~1\Project Zero (Europe) (En,Fr,De,Es,It) [Undub by karas84 v1.3.3] (Japanese Title Screen) (Replace Models).chd
D:\Emulation\Sony - PlayStation 2\PS2 Discs\Tales of Destiny - Director's Cut (Japan, Asia) [T-En by Life Bottle Productions ~1\Tales of Destiny - Director's Cut (Japan, Asia) [T-En by Life Bottle Productions v1.5].chd

As you can see in these examples, I had to rename the folders to containing the CHD files to keep them at 218 characters and ended the folder names with "~1" to show that the rest of the names were cut off.

I understand that this may not affect many users, but I think it's logical to want to keep related files inside a folder for these games, though I can see that they have incredibly long descriptive filenames due to being translations or hacks.

I hope this request will be considered beneficial enough to implement. Perhaps a quick fix would be to use relative paths instead of absolute paths?

@jklphe00 jklphe00 added Enhancement / Feature Request FR: Awaiting Consideration The feature request is awaiting a team members consideration. labels Feb 28, 2025
@Mrlinkwii
Copy link
Contributor

this is not a pcsx2 issue this is a windows issue , if you really want to fix it try this https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later

@jklphe00
Copy link
Author

Following the article you linked, I enabled the long path setting using gpedit.msc, confirmed that it was enabled in regedit, and rebooted my computer, but pcsx2 was still unable to detect games with paths exceeding ~218 characters.

The linked article also specifies that applications must declare their apps to be long path aware. I am wondering if this has been done in pcsx2?

@F0bes F0bes linked a pull request Feb 28, 2025 that will close this issue
@F0bes
Copy link
Member

F0bes commented Feb 28, 2025

Once #12370 has built, can you see if that fixes long pathing for you?

@TheLastRar
Copy link
Contributor

TheLastRar commented Feb 28, 2025

I'm unable to reproduce

I tried the following paths (extending them to > 218) (I just copied the same file about and renamed them)

D:\Emulation\Sony - PlayStation 2\PS2 Discs\Dragon Quest V - The Heavenly Bride (Japan) [T-En by DQ Translations v1.2] (DQ_longerPath\Dragon Quest V - The Heavenly Bride (Japan) [T-En by DQ Translations v1.2] (DQ Style) [n].chd
D:\Emulation\Sony - PlayStation 2\PS2 Discs\Project Zero (Europe) (En,Fr,De,Es,It) [Undub by karas84 v1.3._longerPath\Project Zero (Europe) (En,Fr,De,Es,It) [Undub by karas84 v1.3.3] (Japanese Title Screen) (Replace Models).chd
D:\Emulation\Sony - PlayStation 2\PS2 Discs\Tales of Destiny - Director's Cut (Japan, Asia) [T-En by Life Bottle Productions _longerPath\Tales of Destiny - Director's Cut (Japan, Asia) [T-En by Life Bottle Productions v1.5].chd
D:\Emulation\Sony - PlayStation 2\PS2 Discs\Some Really long path name of something I don't know I'm just testing a bug report so I need a really long name and yep we are still going but just a few characters to go and there\Now I just need a kindof long file name to get be above the path limit.chd

I configured PCSX2 to scan D:\Emulation\Sony - PlayStation 2\PS2 Discs recursively and all files show up

Can you provide further information that might help me repo
Are you on Windows 10 or 11?

@jklphe00
Copy link
Author

jklphe00 commented Mar 1, 2025

Windows 10, but I have figured something out thanks to your work in trying to reproduce.

Since you couldn't reproduce the problem, it hinted that it could be something wrong with my current pcsx2 setup. I set up a fresh portable pcsx2 using the latest nightly on the website and it successfully scanned the games with large paths >218 characters.

I compared the pcsx2.ini files of both installs and found the following that should be of interest —
Old (bad) install:
RecursivePaths = ..\..\PS2 Discs
New (good) install:
RecursivePaths = D:\Emulation\Sony - PlayStation 2\PS2 Discs

For context, both installs of pcsx2 are portable setups on the latest version (v2.3.185).
The old install is in D:\Emulation\Sony - PlayStation 2\PCSX2\pcsx2-nightly-windows-x64-Qt.
The new install is in D:\Emulation\Sony - PlayStation 2\PCSX2\pcsx2-v2.3.185-windows-x64-Qt.
I remember manually changing the RecursivePaths entry for the old install a long time ago to a relative path since I wanted my install to be portable.

So there ya have it, relative paths (oddly) seem to be the culprit. Would be nice to have relative paths working for a truly portable install. The setup wizard would also have to be changed up to build the pcsx2.ini using relative paths instead of absolute paths as well if relative paths do end up working.

@F0bes
Copy link
Member

F0bes commented Mar 1, 2025

Does #12370 work with relative paths?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement / Feature Request FR: Awaiting Consideration The feature request is awaiting a team members consideration.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants