jkboyce / jugglinglab

Juggling Lab juggling animator
https://jugglinglab.org
GNU General Public License v2.0
86 stars 17 forks source link

Check for special characters in filenames #92

Closed jkboyce closed 2 years ago

jkboyce commented 2 years ago

Currently when we save, e.g. a GIF, we auto-populate the file chooser with .gif. This runs a risk of including a character that is disallowed in filenames.

Linux doesn't allow / in filenames, and using a filename with / in Juggling Lab causes an internal error. Also filenames starting with . indicate hidden files, which may cause confusion. Solution:

macOS doesn't allow / in filenames, however, any : in a filename is shown in Finder (and open dialogs) as /, and within the Finder it is disallowed to create a filename containing :. Solution:

Windows doesn't allow \/?:*"><| in filenames. Additionally filenames cannot end in space or .. Lastly, the following filenames are reserved and cannot be used: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9. Solution:

jkboyce commented 2 years ago

Fixed and committed to master branch