aboutsummaryrefslogtreecommitdiff
path: root/hotline/files.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-05 16:43:51 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-05 16:43:51 -0700
commit2d52424e94e617627e4438fd207ee94949409328 (patch)
treeb5a7f01fc7a95040ea27d29c96aa580a2d995bfd /hotline/files.go
parente130e0a2142f123d9d6f9351d0758289f010a1bb (diff)
Implement some special case file descriptions
Diffstat (limited to 'hotline/files.go')
-rw-r--r--hotline/files.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/hotline/files.go b/hotline/files.go
index 478041b..7c2cd1a 100644
--- a/hotline/files.go
+++ b/hotline/files.go
@@ -27,6 +27,17 @@ func fileTypeFromFilename(fn string) fileType {
return defaultFileType
}
+func fileTypeFromInfo(info os.FileInfo) (ft fileType, err error) {
+ if info.IsDir() {
+ ft.CreatorCode = "n/a "
+ ft.TypeCode = "fldr"
+ } else {
+ ft = fileTypeFromFilename(info.Name())
+ }
+
+ return ft, nil
+}
+
func getFileNameList(filePath string) (fields []Field, err error) {
files, err := ioutil.ReadDir(filePath)
if err != nil {