Unix文件名应限制哪些字符? [英] What characters should be restricted from a Unix file name?
本文介绍了Unix文件名应限制哪些字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
考虑一个带有自由文本条目的另存为对话框,用户可以在其中输入文件名作为自由文本,然后单击一个 Save 按钮.然后,该软件将验证文件名,并在文件名有效时保存文件.
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 then validates the file name, and saves the file if the name is valid.
在Unix文件系统上,应在验证中应用哪些规则,例如:
On a Unix file system, what rules should be applied in the validation such that:
- 以后在转义特殊字符等方面,将不难操作该名称.
- 这些规则并没有那么严格,以至于保存文件变得对用户不友好.
那么基本上,应该从Unix文件名中限制的最小个字符集是什么?
So basically, what is the minimum set of characters that should be restricted from a Unix file name?
推荐答案
最小值为斜杠('/')和NULL('\ 0')
The minimum are slash ('/') and NULL ('\0')
这篇关于Unix文件名应限制哪些字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文