support renaming files

This commit is contained in:
Chris Lu
2018-06-06 22:11:01 -07:00
parent b3447f4375
commit 5c25d29272
7 changed files with 169 additions and 70 deletions

View File

@@ -123,7 +123,7 @@ func (f *Filer) FindEntry(p FullPath) (entry *Entry, err error) {
return f.store.FindEntry(p)
}
func (f *Filer) DeleteEntryMetaAndData(p FullPath) (err error) {
func (f *Filer) DeleteEntryMetaAndData(p FullPath, shouldDeleteChunks bool) (err error) {
entry, err := f.FindEntry(p)
if err != nil {
return err
@@ -139,7 +139,9 @@ func (f *Filer) DeleteEntryMetaAndData(p FullPath) (err error) {
}
}
f.deleteChunks(entry)
if shouldDeleteChunks {
f.deleteChunks(entry)
}
return f.store.DeleteEntry(p)
}