Fix problems on windows ()

This commit is contained in:
Antonio Navarro Perez 2021-11-18 11:36:07 -08:00 committed by GitHub
parent df7f1ce8be
commit 66eadf35dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 67 additions and 28 deletions

View file

@ -2,7 +2,7 @@ package fuse
import (
"os"
"path"
"path/filepath"
"runtime"
"github.com/billziss-gh/cgofuse/fuse"
@ -28,7 +28,7 @@ func (s *Handler) Mount(fss map[string]fs.Filesystem) error {
folder := s.path
// On windows, the folder must don't exist
if runtime.GOOS == "windows" {
folder = path.Dir(s.path)
folder = filepath.Dir(s.path)
}
if err := os.MkdirAll(folder, 0744); err != nil && !os.IsExist(err) {
return err