开发者

Java Line separator File .ext separator

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜