stella icon indicating copy to clipboard operation
stella copied to clipboard

Wrong file type detection in ZIP files

Open thrust26 opened this issue 2 years ago • 3 comments

A non-ROM file is detected as directory inside a ZIP file.

ziptest.zip

thrust26 avatar Dec 03 '21 22:12 thrust26

In Linux, the 'readme' is shown as a dir folder, but 'entering' it plays it as if it's a ROM file. So as you say, it's just the detection that is off.

sa666666 avatar Dec 03 '21 23:12 sa666666

Confirmed; I see the problem. It considers a valid ROM as a file, and everything else a directory. The code needs to be reworked to mark a directory as such, and everything else a file. Working on it ...

sa666666 avatar Dec 05 '21 02:12 sa666666

I know now what the issue is, but it will have to wait until the FSNode API is simplified, when we move to std::filesystem in C++17.

sa666666 avatar Jun 12 '22 19:06 sa666666

Now that I'm not using the C++17 std::filesystem anymore (at least for the near future), I have to attack this problem from a different direction.

I'm wondering, why are we even showing non-ROMs at all in the ROM launcher? Even when we do show them, trying to launch them will result in a message saying "not a ROM', or some such. So if that's the case, why even show them? Hiding them completely from the user will render this issue moot.

sa666666 avatar Dec 30 '22 19:12 sa666666

@thrust26, I am now looking at this again. And I still wonder why we even need to show non-ROMs in the Stella launcher at all? All that will happen when attempting to run them is to get a message that it can't be done. If we only allow showing ROMs and directories, then the UI gets simpler, and this issue disappears.

sa666666 avatar Aug 01 '23 20:08 sa666666

To be clear, I'm wondering if the "Toggle file type filter" functionality is needed. Can you think of a valid use case for it?

sa666666 avatar Aug 01 '23 20:08 sa666666

As of now it only gives an overview of other existing files. And maybe it could be used to display e.g. text files (manuals) or images in the future. But generally it doesn't make much sense. It was always there, so I never wondered about it.

It is a problem?

thrust26 avatar Aug 01 '23 20:08 thrust26

Yes, it complicates fixing this very issue when dealing with ZIP files. So if it isn't necessary and we can't see a use case for it, I would like to remove it, and in the process make this issue moot.

sa666666 avatar Aug 01 '23 20:08 sa666666

I probably added this sometime in the (far) past, and no longer know why I did it :smiling_imp:

sa666666 avatar Aug 01 '23 20:08 sa666666

Remove it then. Fine by me.

thrust26 avatar Aug 01 '23 20:08 thrust26

Fixed in https://github.com/stella-emu/stella/commit/49fb4d01bb819628d07f3716a1bf1f8afa650751.

sa666666 avatar Aug 02 '23 20:08 sa666666