MeanEYE / Sunflower

Small and highly customizable twin-panel file manager for Linux with support for plugins.
GNU General Public License v3.0
429 stars 42 forks source link

File extension determined from first dot in string (instead of last). #144

Open hardyharz3n opened 9 years ago

hardyharz3n commented 9 years ago

Thanks for your work!

MeanEYE commented 9 years ago

You are welcome. This is actually a lot harder issue than it seems. You are most likely referring to 2 level extensions like .tag.gz but on the other hand I can't just go and cut off after first dot since that would ruin things like dates in file names etc. Of course POSIX specification doesn't recognize the "extension" as such, everything is just file name.

Can you please explain your use case so I know if there's something I can do to improve that situation. Thanks!

hardyharz3n commented 9 years ago

in my case, the issue arose in case of music data, such as "St. Germain - Rose Rouge.mp3", which would evaluate to "St.[file extension]"

How about using the last dot unless there's only 2 chars behind it, in which case the preceding dot is used?

MeanEYE commented 9 years ago

Ah, your issue is easily fixed, there's an option in Preferences -> Item List -> Operation where you need to turn off "Support second level extension".

Your suggestion about the size of extension makes sense, however everything is a balance of speed and accuracy when loading files. What you suggested is good idea but am afraid implementing it might slow down directory loading considerably. I'll have to do some testing with this and see how it behaves. Perhaps regular expressions can be low cost solution.

Either way thanks for reporting. I'll keep this issue open until I get to test if there's a smarter way of solving this issue.

hardyharz3n commented 9 years ago

Awesome, thanks once again!