文件创建,无需创建新文件夹 [困惑] 来自用户输入

huangapple go评论76阅读模式
英文:

File creation without creating new folder [confusion] from user-input

问题

让我们假设有一个用户想要一个名为:"test/lasdhjal.txt" 的文件,不管是什么文件。现在,如果我将其放入一个新的 File(input); 对象内部,它会认为 test/ 是一个文件夹,而实际上它是名称的一部分。我可以采取什么措施来解决这个问题?

英文:

Lets say we have a user who wants a file named:
"test/lasdhjal.txt", whatever. Now if I put this into a new File(input); object inside, it will think that test/ is a folder, whilst it's a part of the name. What can I do against that?

答案1

得分: 1

不允许在文件名中使用“/”是在内核级别强制实施的限制,这不是您可以规避的内容。

英文:

No, the limitation of not allowing a "/" in a file name is imposed at the kernel level, this is not something you can get around.

huangapple
  • 本文由 发表于 2020年4月11日 05:08:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/61148705.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定