Any way to access fstat.st_blocks from Java (UnixFileAttributesView)

Brian Burkhalter brian.burkhalter at oracle.com
Fri Jun 28 15:44:51 UTC 2019


> On Jun 28, 2019, at 7:18 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
>> Any hints to get the file size on disk from Java that uses the st_blocks and st_blksize behind the scenes?
>> 
> There isn't anything at this time. You are right that the "unix" view could expose a "blocks" attribute. The block size is already exposed by FileStore::getBlockSize - the motivation for that was sizing and aligning buffers for use with direct I/O.

Maybe an enhancement should be filed?

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190628/450b1a7b/attachment.html>


More information about the nio-dev mailing list