开发者

Java Line separator File .ext separator

开发者 https://www.devze.com 2022-12-29 11:30 出处:网络
i am wo开发者_运维知识库ndering regarding Java: is there a file extension separator? like *.doc, the \".\" being the question.

i am wo开发者_运维知识库ndering regarding Java: is there a file extension separator?

like *.doc, the "." being the question.

i know there is a line.separator. just would like my app to be portable so i need to know.

thank you.


The . being a filename from file extension separator is an artifact of DOS and it's 8.3 filename limitations. On Windows, MacOS X, Linus, etc that's no longer that case. . is just any other character (although a leading . on Linux/Unix filesystems indicates a hidden file).

Windows systems still use the convention (even though you can create a filename with as many periods as you wish) as the extension is still used to file type and association. Linux/Unix/MacOS X tend to rely on magic numbers more than file extensions although there are conventions used there too (eg .pl' for Perl files,.sh` for Shell scripts and so forth) but, unlike Windows, these are just conventions that have no OS meaning.

So basically there is no concept of "file separator". Not in a universal sense anyway.

0

精彩评论

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

关注公众号