- f2 is a hard link to f1
- f3 is a symbolic link to f2
When retrieving the unix attributes (thanks to Files.readAttributes(p, "unix:*"), the nlink is 2, it should be 1.
Testcase:
final Path p = FileSystems.getDefault().getPath("path to f3");
Map unixFileAttributes = Files.readAttributes(p, "unix:*");
for(Object obj : unixFileAttributes.entrySet()){
Entry e = (Entry)obj;
System.out.println(e.getKey()+"="+e.getValue());
}
lastAccessTime=2013-04-10T15:06:50Z
isSymbolicLink=false
rdev=0
ino=11075442
mode=33188
isOther=false
ctime=2013-04-10T15:06:33Z
fileKey=(dev=1000002,ino=11075442)
creationTime=2013-04-08T09:16:07Z
size=20
gid=...
dev=16777218
nlink=2
uid=...
owner=...
permissions=[OTHERS_READ, OWNER_WRITE, OWNER_READ, GROUP_READ]
group=...
lastModifiedTime=2013-04-08T09:16:07Z
isDirectory=false
isRegularFile=true
- f3 is a symbolic link to f2
When retrieving the unix attributes (thanks to Files.readAttributes(p, "unix:*"), the nlink is 2, it should be 1.
Testcase:
final Path p = FileSystems.getDefault().getPath("path to f3");
Map unixFileAttributes = Files.readAttributes(p, "unix:*");
for(Object obj : unixFileAttributes.entrySet()){
Entry e = (Entry)obj;
System.out.println(e.getKey()+"="+e.getValue());
}
lastAccessTime=2013-04-10T15:06:50Z
isSymbolicLink=false
rdev=0
ino=11075442
mode=33188
isOther=false
ctime=2013-04-10T15:06:33Z
fileKey=(dev=1000002,ino=11075442)
creationTime=2013-04-08T09:16:07Z
size=20
gid=...
dev=16777218
nlink=2
uid=...
owner=...
permissions=[OTHERS_READ, OWNER_WRITE, OWNER_READ, GROUP_READ]
group=...
lastModifiedTime=2013-04-08T09:16:07Z
isDirectory=false
isRegularFile=true