From 6f2d80962f1c79495c00d78fbf961acb8252368d Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Wed, 14 Dec 2022 03:33:55 -0800 Subject: [PATCH] initial commits --- fileinfo.go | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 fileinfo.go diff --git a/fileinfo.go b/fileinfo.go new file mode 100644 index 0000000..4ad3a42 --- /dev/null +++ b/fileinfo.go @@ -0,0 +1,39 @@ +package strfs + +import ( + "io/fs" + "time" +) + +type internalFileInfo struct { + mode fs.FileMode + modtime time.Time + name string + size int64 +} + +var _ fs.FileInfo = &internalFileInfo{} + +func (receiver internalFileInfo) IsDir() bool { + return 0 != (receiver.mode & fs.ModeDir) +} + +func (receiver internalFileInfo) Mode() fs.FileMode { + return receiver.mode +} + +func (receiver internalFileInfo) ModTime() time.Time { + return receiver.modtime +} + +func (receiver internalFileInfo) Name() string { + return receiver.name +} + +func (receiver internalFileInfo) Size() int64 { + return receiver.size +} + +func (receiver internalFileInfo) Sys() any { + return nil +}