forked from TrueCloudLab/restic
mount: use os instead of fs package
This commit is contained in:
parent
24f4e780f1
commit
65a7157383
2 changed files with 1 additions and 8 deletions
|
@ -15,7 +15,6 @@ import (
|
||||||
"github.com/restic/restic/internal/errors"
|
"github.com/restic/restic/internal/errors"
|
||||||
"github.com/restic/restic/internal/restic"
|
"github.com/restic/restic/internal/restic"
|
||||||
|
|
||||||
resticfs "github.com/restic/restic/internal/fs"
|
|
||||||
"github.com/restic/restic/internal/fuse"
|
"github.com/restic/restic/internal/fuse"
|
||||||
|
|
||||||
systemFuse "github.com/anacrolix/fuse"
|
systemFuse "github.com/anacrolix/fuse"
|
||||||
|
@ -122,7 +121,7 @@ func runMount(ctx context.Context, opts MountOptions, gopts GlobalOptions, args
|
||||||
|
|
||||||
// Check the existence of the mount point at the earliest stage to
|
// Check the existence of the mount point at the earliest stage to
|
||||||
// prevent unnecessary computations while opening the repository.
|
// prevent unnecessary computations while opening the repository.
|
||||||
if _, err := resticfs.Stat(mountpoint); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(mountpoint); errors.Is(err, os.ErrNotExist) {
|
||||||
Verbosef("Mountpoint %s doesn't exist\n", mountpoint)
|
Verbosef("Mountpoint %s doesn't exist\n", mountpoint)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,12 +60,6 @@ func Link(oldname, newname string) error {
|
||||||
return os.Link(fixpath(oldname), fixpath(newname))
|
return os.Link(fixpath(oldname), fixpath(newname))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stat returns a FileInfo structure describing the named file.
|
|
||||||
// If there is an error, it will be of type *PathError.
|
|
||||||
func Stat(name string) (os.FileInfo, error) {
|
|
||||||
return os.Stat(fixpath(name))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lstat returns the FileInfo structure describing the named file.
|
// Lstat returns the FileInfo structure describing the named file.
|
||||||
// If the file is a symbolic link, the returned FileInfo
|
// If the file is a symbolic link, the returned FileInfo
|
||||||
// describes the symbolic link. Lstat makes no attempt to follow the link.
|
// describes the symbolic link. Lstat makes no attempt to follow the link.
|
||||||
|
|
Loading…
Reference in a new issue