aboutsummaryrefslogtreecommitdiffstats
path: root/utils/fs/fs.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/fs/fs.go')
-rw-r--r--utils/fs/fs.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/utils/fs/fs.go b/utils/fs/fs.go
index 463425c..7e6c01f 100644
--- a/utils/fs/fs.go
+++ b/utils/fs/fs.go
@@ -14,10 +14,9 @@ var (
)
type Filesystem interface {
- //Create opens a file in write-only mode.
Create(filename string) (File, error)
- //Open opens a file in read-only mode.
Open(filename string) (File, error)
+ OpenFile(filename string, flag int, perm os.FileMode) (File, error)
Stat(filename string) (FileInfo, error)
ReadDir(path string) ([]FileInfo, error)
TempFile(dir, prefix string) (File, error)
@@ -38,3 +37,16 @@ type File interface {
}
type FileInfo os.FileInfo
+
+type BaseFile struct {
+ BaseFilename string
+ Closed bool
+}
+
+func (f *BaseFile) Filename() string {
+ return f.BaseFilename
+}
+
+func (f *BaseFile) IsClosed() bool {
+ return f.Closed
+}