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.
精彩评论