Skip to content

Commit

Permalink
Merge pull request #34 from jxsl13/chore/cleanup
Browse files Browse the repository at this point in the history
cleanup & remove prefixFile from public api
  • Loading branch information
jxsl13 committed Jul 10, 2024
2 parents 9518f85 + 8d20d87 commit 7ec6777
Show file tree
Hide file tree
Showing 8 changed files with 427 additions and 223 deletions.
18 changes: 15 additions & 3 deletions backupfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,11 @@ func (fsys *BackupFS) tryRemoveBackup(name string) (err error) {
}
}()
// remove file/symlink
return fsys.backup.Remove(name)
err := fsys.backup.Remove(name)
if err != nil {
return err
}
return nil
}

dirs := make([]string, 0)
Expand Down Expand Up @@ -548,7 +552,11 @@ func (fsys *BackupFS) tryRemoveBackup(name string) (err error) {
}

// delete files
return fsys.backup.Remove(path)
err = fsys.backup.Remove(path)
if err != nil {
return err
}
return nil
})
if err != nil {
return err
Expand Down Expand Up @@ -715,7 +723,11 @@ func (fsys *BackupFS) OpenFile(name string, flag int, perm fs.FileMode) (File, e

if flag == os.O_RDONLY {
// in read only mode the perm is not used.
return fsys.base.OpenFile(name, os.O_RDONLY, 0)
f, err := fsys.base.OpenFile(name, os.O_RDONLY, 0)
if err != nil {
return nil, &os.PathError{Op: "open", Path: name, Err: fmt.Errorf("open failed: %w", err)}
}
return f, nil
}

// not read only opening -> backup
Expand Down
102 changes: 0 additions & 102 deletions hidden_utils.go

This file was deleted.

Loading

0 comments on commit 7ec6777

Please sign in to comment.