目录名称中的空格

发布于 2024-10-17 01:26:27 字数 179 浏览 3 评论 0原文

在目录名称中添加空格仍然是一个大问题吗?我一直在阅读一些文章,但所有文章都是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猫性小仙女 2024-10-24 01:26:27

URL 中的空格仍然是需要转义或编码的特殊字符(+%20)。

Spaces in URLs are still special characters that need to be escaped or encoded (either a + or %20).

初见终念 2024-10-24 01:26:27

好吧,在执行外部进程(例如来自 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.

没有心的人 2024-10-24 01:26:27

我刚刚遇到了问题所在。我在邮件合并 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文