开发者

Why can't a number character cannot be used as a directory name? (Java)

开发者 https://www.devze.com 2023-01-27 09:32 出处:网络
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.

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 dow开发者_如何学Cnload 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消