Hard Links
Alan Bateman
Alan.Bateman at oracle.com
Fri May 13 13:12:05 PDT 2011
Scott Palmer wrote:
> :
> What about for Windows? It seems that the JRE should abstract this, if possible, so I don't need OS specific bits in my code unless absolutely necessary. It is odd to have this implementation-specific and OS-specific thing when the decision to support hard links was already made with the addition of the createLink API. I assume since the early docs referenced a linkCount() API that there was a conscious decision to remove it, I'm curious about the reasons for that. Or maybe it was just something that accidentally got lost when the API was juggled around and FileRef went away?
>
> Is there are reason this isn't part of the "basic" view?
>
>
The link count is something that we would expect only very few
applications will likely need. Off-hand I don't recall anyone asking for
it. We did have it in an early prototype but it isn't really feasible
everywhere, particularly with custom file systems. On Windows then it
would impact performance if it were defined by BasicFileAttributes
(based on various measurements that we did on the various win32 calls
for accessing file attributes). So for now none of the file attribute
views defined by the API define the link count. The API is extensible so
that providers can define their own view of the attributes and in our
provider then the only view that currently supports it in the "unix" view.
-Alan.
More information about the nio-discuss
mailing list