Hard Links

Alan Bateman Alan.Bateman at oracle.com
Fri May 13 08:58:47 PDT 2011


Scott Palmer wrote:
> :
>
> There are many cases where you would want to break hard links when you need to make changes to a file (some sort of copy-on-write semantics), but you can't code it if you don't know if the file is linked.  I see the isSymbolicLink method, but nothing similar for hard links.
>
> Scott
The API doesn't have a method specifically for this but our 
implementation can return the number of links with 
Files.getAttribute(path, "unix:nlink").

-Alan.



More information about the nio-discuss mailing list