private static void printHeader(Sigar sigar, FileInfo info)
throws SigarException {
String file = info.getName();
FileInfo link = sigar.getLinkInfo(file);
if (link.getType() == FileInfo.TYPE_LNK) {
try {
System.out.println(file + " -> " +
new File(file).getCanonicalPath());
} catch (IOException e) {
e.printStackTrace();
}
}
System.out.println(link.getTypeChar() +
info.getPermissionsString() + "\t" +
info.getUid() + "\t" + info.getGid() + "\t" +
info.getSize() + "\t" +
new Date(info.getMtime()) + "\t" +
file);