有没有无效的Linux文件名? [英] Are there any invalid linux filenames?

查看:284
本文介绍了有没有无效的Linux文件名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想创建一个保证不能表示文件名的字符串,我可以在Windows中添加下列其中一个字符:

  \ /:*? | < > 



  this-is-a-filename.png 

?this-is-not.png

有什么办法可以在Linux上将字符串识别为不可能是文件?

解决方案

除了'/''\0'之外,几乎没有任何限制,您可以使用任何东西然而,有些人认为这不是个好主意非常灵活。

If I wanted to create a string which is guaranteed not to represent a filename, I could put one of the following characters in it on Windows:

\ / : * ? | < >

e.g.

this-is-a-filename.png

?this-is-not.png

Is there any way to identify a string as 'not possibly a file' on Linux?

There are almost no restrictions - apart from '/' and '\0', you're allowed to use anything. However, some people think it's not a good idea to allow this much flexibility.

这篇关于有没有无效的Linux文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆