feat: Implement Remove and RemoveAll

This commit is contained in:
Felicitas Pojtinger
2021-12-20 22:09:40 +01:00
parent 2c3646aaa6
commit ed1299260b
2 changed files with 2 additions and 6 deletions

View File

@@ -150,10 +150,6 @@ func (f *File) WriteString(s string) (ret int, err error) {
func (f *File) closeWithoutLocking() error {
log.Println("File.closeWithoutLocking", f.name)
if f.info.IsDir() {
return ErrIsDirectory
}
if f.reader != nil {
if err := f.reader.Close(); err != nil {
return err

View File

@@ -118,13 +118,13 @@ func (f *FileSystem) OpenFile(name string, flag int, perm os.FileMode) (afero.Fi
func (f *FileSystem) Remove(name string) error {
log.Println("FileSystem.Remove", name)
panic(ErrNotImplemented)
return f.writeOps.Delete(name)
}
func (f *FileSystem) RemoveAll(path string) error {
log.Println("FileSystem.RemoveAll", path)
panic(ErrNotImplemented)
return f.writeOps.Delete(path)
}
func (f *FileSystem) Rename(oldname, newname string) error {