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())
+ ftype, err := guessFiletype(dirname + pathSep + fi.Name())
+ if check(err, "guessFiletype "+dirname+pathSep+fi.Name()) != nil {
+ continue
+ }
list += ftype + fi.Name() + " | " + humanSize(fi.Size()) + " | " + fts + "\t" + selector + pathSep + fi.Name() + loc
} else if cfg.fsymln && fmode&os.ModeSymlink != 0 {
// create a reference with attributes matching the link target
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())
+ ftype, err := guessFiletype(dirname + pathSep + fi.Name())
+ if check(err, "guessFiletype "+dirname+pathSep+fi.Name()) != nil {
+ continue
+ }
list += ftype + fi.Name() + " | " + humanSize(lfi.Size()) + " | " + fts + "\t" + selector + pathSep + fi.Name() + loc
}
}
}
buffer = buffer[:n]
contentType := http.DetectContentType(buffer)
- //tracer.Print("Content Type " + path + " == "+ contentType)
shortType := strings.Split(contentType, ";")[0]
genType := strings.Split(shortType, "/")[0]
gopherType := "9"