How do I get the file size on disk?

As I know, File.length() can be used to get the file size.

But I would like to know how to get the actual file size on disk?

[137 byte] By [leolee1022a] at [2007-11-27 11:29:21]
# 1

does someone help?

leolee1022a at 2007-7-29 16:27:25 > top of Java-index,Java Essentials,Java Programming...
# 2

If you mean the file size rounded up to the next block boundary, you can do it yourself if you know the block size. If you don't mean that I don't know what you mean.

ejpa at 2007-7-29 16:27:25 > top of Java-index,Java Essentials,Java Programming...
# 3

Actually, I really don't know what you say.

But when you see the properties of a file in Windows, you can see there are two file size. One is called "SIze" and the other one is called "Size on disk".

Therefore, I would like to know the size on disk but not just the size.

leolee1022a at 2007-7-29 16:27:25 > top of Java-index,Java Essentials,Java Programming...
# 4

what would that number mean to you?

TuringPesta at 2007-7-29 16:27:25 > top of Java-index,Java Essentials,Java Programming...