how often must file store space attributes be read?
Salter, Thomas A
Thomas.Salter at unisys.com
Tue Jun 21 07:00:36 PDT 2011
FileStore.getUsableSpace says the following (with similar wording in FileStore.getUnallocatedSpace):
The returned number of available bytes is a hint, but not a guarantee, that it is possible to use most or any of these bytes. The number of usable bytes is most likely to be accurate immediately after the space attributes are obtained. It is likely to be made inaccurate by any external I/O operations including those made on the system outside of this Java virtual machine.
The phrase "after the space attributes are obtained" seems leftover from the earlier implementations that contained a readFileStoreSpaceAttributes method.
Is the intent of this phrase that an implementation could choose to read the attributes only when the FileStore object is instantiated? Both the UnixFileStore and the WIndowsFileStore objects currently reread the attributes on every access to the three space methods.
We're porting to a system we're it's somewhat expensive to get the space attributes and we get all three at once. We'd prefer to read them only once. Yet experience has shown that portable applications assume that the behavior on Windows or Linux is the behavior they'll find everywhere, so unless the docs are very clear, we're force to match the Windows and Linux implementations.
Tom Salter | Software Engineer | Java & Middleware Development
Unisys | 476 Swedesford Road | Malvern, PA 19355 | 610-648-2568 | N385-2568
[cid:image001.gif at 01CC2FF8.0D319590]
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20110621/5f571f74/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 2511 bytes
Desc: image001.gif
Url : http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20110621/5f571f74/attachment.gif
More information about the nio-discuss
mailing list