What character sequence should I not allow in a filename?

后端 未结 6 1913
别跟我提以往
别跟我提以往 2020-12-06 04:55

I found out after testing that linux allows any character in a file name except for / and null (\\0). So what sequence should I not allow in a file

6条回答
  •  一向
    一向 (楼主)
    2020-12-06 05:37

    Are you developing an application where you have to ask the user to create files themselves? If that's what you are doing, then you can set the rules in your application. (eg only allow [a-zA-Z0-9_.] and reject the rest of special characters.) this is much simpler to enforce.

提交回复
热议问题