aspose file tools*
The moose likes Java in General and the fly likes How to check file size on disk Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to check file size on disk" Watch "How to check file size on disk" New topic
Author

How to check file size on disk

scott Edwards
Greenhorn

Joined: Jul 25, 2003
Posts: 6
I need to check the size that a file occupies on disk, not the actual file size.
Could somebody please help me out?
Thanks a lot.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Meaning the size of the allocation blocks dedicated to the file, I presume.
I don't think there's any way to do this from Java.


[Jess in Action][AskingGoodQuestions]
scott Edwards
Greenhorn

Joined: Jul 25, 2003
Posts: 6
Yes, I mean
the size of the allocation blocks dedicated to the file.
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
In Java there is nothing to do with hadware or Operating System. You can only find the No. of bytes in a File not in terms of disk space.
The only way is to write Operating System Specific code (in C Language)to find out the file size and access the code using JNI from Java.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to check file size on disk