目录名称中的空格
在目录名称中添加空格仍然是一个大问题吗?我一直在阅读一些文章,但所有文章都是 2000 年代初的。现在有问题吗?
对于那些不明白我的意思的人: public_html/space directory/index.html
如果这仍然是一个问题,为什么我在命名文件和目录时不应该使用空格?
Is putting a space in a directory name still a big deal? I've been doing some reading, but all the articles are from the early 2000s. Is it a problem now?
For those who don't get what I mean: public_html/space directory/index.html
If this is still an issue, why shouldn't I use spaces when naming files and directories?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
URL 中的空格仍然是需要转义或编码的特殊字符(
+
或%20
)。Spaces in URLs are still special characters that need to be escaped or encoded (either a
+
or%20
).好吧,在执行外部进程(例如来自 ant 或 Java 的 ProcessBuilder)时我仍然交叉手指。如果您只是将此目录传递给命令中的外部进程 - 它可能会分成两个参数,这显然不是您想要的。
在某些用例中仍然需要一些引用和注意空格。
Well, I am still crossing fingers when executing external processes (from ant or Java's ProcessBuilder for example). If you just pass this dir to the external process within the command - it may break apart in two arguments which is clearly not what you want.
Some quoting and minding the spaces is still required in some usecases.
我刚刚遇到了问题所在。我在邮件合并 MS Word 中有一个表,在源中看起来像这样:
{database \d "m:/shared/directname withspaces/tbi.xlsx" \s "select [DEPT], [BENEFIT] , [FULL_AMOUNT] from [SC$] where [FILE_NO] ='379107'" \l "15" \b "49" \h}
当您进行邮件合并时,对于每个字母,word 都会抱怨找不到数据来源。如果目录名称更改为“directnamewithspaces”,则没有问题。
I just ran into where it was a problem. I had a table in a mailmerge MS word which looked something like this in source:
{database \d "m:/shared/directname with spaces/tbi.xlsx" \s "select [DEPT], [BENEFIT] , [FULL_AMOUNT] from [SC$] where [FILE_NO] ='379107'" \l "15" \b "49" \h}
When you went to do the mail merge, for EVERY letter, word would complain that it could not find the data source. If the directory name was changed to "directnamewithspaces" it had no problem.