为什么数字字符不能用作目录名? (爪哇)
我的 zip 文件中有一个名为“4”的文件夹,其中包含一些图像文件。当我检查 zip 的内容时,isDirectory 未将“4”文件夹注册为目录。
当 4 重命名为“tour_4”时,isDirectory 返回 true!有谁知道这是吗?
目录名称可以是单个数字字符吗?
编辑-好的我发现这与名字无关。这可能与文件系统有关。我想做的是从网络下载并解压缩文件。当我在本地(Windows 文件系统)创建 zip 时,它工作正常 - 当从网络(Linux 文件系统)下载它时,它找不到目录名。
I have a folder with the name '4' in a zip file containing some image files. When I check the contents of the zip, isDirectory does not register the '4' folder as a directory.
When 4 is renamed to 'tour_4' isDirectory returns true! Does anyone know this is?
Can a directory name be a single number character?
EDIT - OK I've discovered it's nothing to do with the name. It maybe something to do with file system. What I'm trying to do is download and unzip a file from the web. When I create the zip locally (windows file system) it works fine - when it's downloaded from the web (linux file system) it doesn't find the directory name.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用“4”来指代目录名称,还是使用 4(不带引号)?您应该使用“4”,因为尽管名称看起来像数字,但它仍然是一个字符串。
Do you use '4' to refer to the directory name, or 4 (without the quotes)? You should use '4', because even though the name looks like a number, it is still a string.