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.go19
1 files changed, 3 insertions, 16 deletions
diff --git a/utils/fs/fs.go b/utils/fs/fs.go
index 9be0f88..4eaad15 100644
--- a/utils/fs/fs.go
+++ b/utils/fs/fs.go
@@ -8,13 +8,15 @@ import (
)
var (
- ErrClosed = errors.New("File: Writing on closed file.")
+ ErrClosed = errors.New("file: Writing on closed file.")
ErrReadOnly = errors.New("this is a read-only filesystem")
ErrNotSupported = errors.New("feature not supported")
)
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)
Stat(filename string) (FileInfo, error)
ReadDir(path string) ([]FileInfo, error)
@@ -35,18 +37,3 @@ type File interface {
}
type FileInfo os.FileInfo
-
-type BaseFile struct {
- filename string
- closed bool
-}
-
-//Filename returns the filename from the File
-func (f *BaseFile) Filename() string {
- return f.filename
-}
-
-//IsClosed returns if te file is closed
-func (f *BaseFile) IsClosed() bool {
- return f.closed
-}