What characters should be restricted from a Unix file name?

后端 未结 7 658
闹比i
闹比i 2020-12-02 14:56

Consider a Save As dialog with a free text entry where the user enters a file name as free text, then clicks a Save button. The software t

7条回答
  •  青春惊慌失措
    2020-12-02 15:43

    Firstly, what you're describing is black listing. Your better option is to white list your characters, as it is easier (from a user perspective) to have characters inserted rather than taken away.

    In terms of what would be good in a unix environment:

    • a-z
    • A-Z
    • 0-9
    • underscore (_)
    • dash (-)
    • period (.)

    Should cover your basics. Spaces can be okay, but make things difficult. Windows users love them, unix/linux don't. So depending on your target audience choose accordingly.

提交回复
热议问题