开发者

Java Maximum File Size

Is there an cross-platform way to determine the maximum file size of the ho开发者_运维百科st OS in Java?


No, maximum file size is file system dependent. (you can see a comparison here). You can figure out the file system type using a platform specific manner (for example, mount on linux).


The largest file is surely no larger than the amount of free space, which you can get via

long FileSystemUtils.freeSpaceKb(String path)

from Apache Commons IO

On JDK 6, you can use File.getFreeSpace() to find the free space of the partition containing the file.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜