continue
}
fmode := fi.Mode()
+ fts := humanDate(fi.ModTime())
if fmode.IsDir() {
// create a directory reference
- list += "1" + fi.Name() + "\t" + selector + pathSep + fi.Name() + loc
+ list += "1" + fi.Name() + " | DIR | " + fts + "\t" + selector + pathSep + fi.Name() + loc
} else if fmode.IsRegular() {
// create a file reference
ftype, _ := guessFiletype(dirname + pathSep + fi.Name())
- list += ftype + fi.Name() + " (" + humanSize(fi.Size()) + ")\t" + selector + pathSep + fi.Name() + loc
+ list += ftype + fi.Name() + " | " + humanSize(fi.Size()) + " | " + fts + "\t" + selector + pathSep + fi.Name() + loc
} else if cfg.fsymln == true && fmode&os.ModeSymlink != 0 {
- // create a reference with a type matching the link target
+ // create a reference with attributes matching the link target
linktarget, _ := os.Readlink(dirname + pathSep + fi.Name())
if linktarget[:1] != pathSep {
linktarget = dirname + pathSep + linktarget
if check(err, "canonicalizePath "+path) == nil {
lfi, err := os.Stat(path)
if check(err, "Stat "+path) == nil {
- if lfi.IsDir() {
+ fmode := fi.Mode()
+ fts := "[" + humanDate(lfi.ModTime()) + "]"
+ if fmode.IsDir() {
// link points to a directory
- list += "1" + fi.Name() + "\t" + selector + pathSep + fi.Name() + loc
- } else if lfi.Mode().IsRegular() {
+ list += "1" + fi.Name() + " | DIR | " + fts + "\t" + selector + pathSep + fi.Name() + loc
+ } else if fmode.IsRegular() {
// link points to a regular file
ftype, _ := guessFiletype(dirname + pathSep + fi.Name())
- list += ftype + fi.Name() + " (" + humanSize(lfi.Size()) + ")\t" + selector + pathSep + fi.Name() + loc
+ list += ftype + fi.Name() + " | " + humanSize(lfi.Size()) + " | " + fts + "\t" + selector + pathSep + fi.Name() + loc
}
}
}