forked from TrueCloudLab/frostfs-node
[#211] blobstor: Implement Exists method
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
1ba556f5e7
commit
59f7cf9873
2 changed files with 54 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue