aboutsummaryrefslogtreecommitdiffstats
path: root/utils/fs
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-10 01:48:43 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-10 01:48:43 +0200
commit6f1d1e00a7c615209cf6b25e314d033bda3b5d09 (patch)
tree51492dae8b010a25a2116e5c8cbeadeef1fa3726 /utils/fs
parente013b297b14949aadaec66deaedc130e86c30afb (diff)
downloadgo-git-6f1d1e00a7c615209cf6b25e314d033bda3b5d09.tar.gz
storage: filesystem ref storage, and not not exists file handling
Diffstat (limited to 'utils/fs')
-rw-r--r--utils/fs/os.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/utils/fs/os.go b/utils/fs/os.go
index 1ae4204..51af921 100644
--- a/utils/fs/os.go
+++ b/utils/fs/os.go
@@ -36,7 +36,7 @@ func (fs *OS) Create(filename string) (File, error) {
}
return &OSFile{
- BaseFile: BaseFile{filename: fullpath},
+ BaseFile: BaseFile{filename: filename},
file: f,
}, nil
}
@@ -60,14 +60,8 @@ func (fs *OS) ReadDir(path string) ([]FileInfo, error) {
}
func (fs *OS) Rename(from, to string) error {
- if !filepath.IsAbs(from) {
- from = fs.Join(fs.RootDir, from)
- }
-
- if !filepath.IsAbs(to) {
- to = fs.Join(fs.RootDir, to)
- }
-
+ from = fs.Join(fs.RootDir, from)
+ to = fs.Join(fs.RootDir, to)
return os.Rename(from, to)
}
@@ -80,7 +74,7 @@ func (fs *OS) Open(filename string) (File, error) {
}
return &OSFile{
- BaseFile: BaseFile{filename: fullpath},
+ BaseFile: BaseFile{filename: filename},
file: f,
}, nil
}