[#211] blobstor: Implement Exists method

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-25 14:18:54 +03:00 committed by Alex Vanin
parent 1ba556f5e7
commit 59f7cf9873
2 changed files with 54 additions and 5 deletions

View file

@ -34,10 +34,9 @@ func (b *BlobStor) DeleteBig(prm *DeleteBigPrm) (*DeleteBigRes, error) {
}
func (t *fsTree) delete(addr *object.Address) error {
p := t.treePath(addr)
if _, err := os.Stat(p); os.IsNotExist(err) {
return errFileNotFound
p, err := t.exists(addr)
if err != nil {
return err
}
return os.Remove(p)