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

Exclude "System Volume Information" explicitly from directory listing #15833

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

zoltanvb
Copy link
Contributor

Description

Okay, bear with me for a moment. It is not as bad of a hack as it looks like, though I can understand if this gets rejected.

I started investigating #15831 and found out that there is no straightforward way to get the hidden attribute of FAT file systems on non-Windows systems. (I would say specifically for PS2 in the current SDK there is no way, since it instructs to use stat() that does not transfer this attribute).
But even a non-Windows RA install can meet such entry if an USB drive is used under Windows and then loaded to RA, such as transferring ROMs to an embedded system: a directory called "System Volume Information" will appear in the root. IMO it makes sense to treat this special entry as a hidden one. A few lines earlier, entries starting with dot are also excluded without regard to platform, although they do not hold special meaning under Windows.

Note: RA compiled for Windows excludes actual hidden entries elsewhere (in retro_vfs_opendir_impl() ).

Related Issues

#15831

Related Pull Requests

#14724 has brought a change in behavior on PS2, but it was also wrong earlier, just in a different way, so this is no reason to revert that (and it fixes a lot of other things). Current PS2 RA behavior is consistent with a desktop Linux RA install.

@LibretroAdmin
Copy link
Contributor

OK, just one thought, would it make sense to put this behind a _WIN32 ifdef since it only pertains to Windows? Or is there a reason for doing it without?

@hizzlekizzle
Copy link
Contributor

I think this applies to any FAT device that's been touched by Windows at least once, right? So it applies to non-Windows settings, as well?

@zoltanvb
Copy link
Contributor Author

It is not needed when RA is running on Windows, since in that case hidden directories are filtered using the attributes:
https://github.com/libretro/RetroArch/blob/da59b8c9ac34cd9d732b5233fb6186ca6097e994/libretro-common/vfs/vfs_implementation.c#L1123C14-L1123C14

It can be put behind something like:
#if (defined(linux) || defined(unix) || defined(PS2))

@LibretroAdmin
Copy link
Contributor

I guess if it applies to any FAT device it might make sense to keep it the way it is I guess as @hizzlekizzle suggested.

@zoltanvb
Copy link
Contributor Author

It applies to any FAT device being read from something else than Windows.

@hizzlekizzle
Copy link
Contributor

right, so if anything, it would be #if !defined __WIN32, since Windows already hides it.

@LibretroAdmin LibretroAdmin merged commit 9d46953 into libretro:master Oct 30, 2023
22 checks passed
JoeOsborn pushed a commit to JoeOsborn/RetroArch that referenced this pull request Nov 2, 2023
@zoltanvb zoltanvb deleted the hidden_dir branch December 1, 2023 20:22
Sunderland93 pushed a commit to Sunderland93/RetroArch that referenced this pull request Dec 26, 2024
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

Successfully merging this pull request may close these issues.

3 participants