Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgofuse refactoring #26

Merged
merged 12 commits into from
Dec 21, 2022
380 changes: 187 additions & 193 deletions internal/filesystem/cgofuse/directory.go

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions internal/filesystem/cgofuse/dirstat_other.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//go:build !nofuse && !windows

package cgofuse

import (
"io/fs"

"github.com/winfsp/cgofuse/fuse"
)

// [2022.11.15] readdir-plus in cgofuse is only supported on Windows.
// If support for a system is added in cgofuse,
// metadata should be returned within `readdir` in this project as well.
// This function is a no-op since FUSE will use `getattr` instead
// to retrieve metadata on systems without the readdir-plus capability.
func dirStat(fs.DirEntry, fuseContext) (*fuse.Stat_t, error) { return nil, nil }
19 changes: 19 additions & 0 deletions internal/filesystem/cgofuse/dirstat_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//go:build !nofuse

package cgofuse

import (
"io/fs"

"github.com/winfsp/cgofuse/fuse"
)

func dirStat(ent fs.DirEntry, fCtx fuseContext) (*fuse.Stat_t, error) {
info, err := ent.Info()
if err != nil {
return nil, err
}
stat := new(fuse.Stat_t)
goToFuseStat(info, fCtx, stat)
return stat, nil
}
3 changes: 3 additions & 0 deletions internal/filesystem/cgofuse/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package cgofuse implements a wrapper around [fs.FS]
// to make it compatible with the [fuse.FileSystemHost] interface.
package cgofuse
32 changes: 0 additions & 32 deletions internal/filesystem/cgofuse/errors.go

This file was deleted.

Loading