C2FO / vfs

Pluggable, extensible virtual file system for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mem FS doesn't remove fs entries when location.DeleteFile is called

funkyshu opened this issue · comments

Describe the bug
Mem backend doesn't remove filesystem entries when deleted from location.DeleteFile() but rather sets is value to nil. file.Delete() appears to delete properly.

To Reproduce
Steps to reproduce the behavior:

  1. Call NewFile on mem fs and Touch or Write/Close to make them "exist".
  2. range over location.List() files
  3. calling file.Exists() on each, no error expected
  4. calling location.DeleteFile(file) on each, no error expected
  5. Now range over location.List() files (should return no files but it does)
  6. calling file.Exists() results in nil pointer dereference panic

Expected behavior
Calling location.List() after location.DeleteFile(file) should return no results