@@ 40,6 40,20 @@ func createDirectoryIndex(treeRootPath, path string) {
}
filePath := filepath.Join(treeRootPath, path, file.Name())
+
+ if file.Mode()&os.ModeSymlink != 0 {
+ dest, err := os.Readlink(filePath)
+ check(err)
+
+ symlink, err := os.Create(filePath + ".txt")
+ check(err)
+ symlink.WriteString("symlink to: " + dest)
+
+ check(symlink.Close())
+ index.WriteString("=> " + file.Name() + ".txt " + file.Name() + "\n")
+ continue
+ }
+
detectedMIME, err := mimetype.DetectFile(filePath)
check(err)