Added FUSE support #55

Merged
Elara6331 merged 65 commits from yannickulrich/itd:fuse into master 2023-03-25 22:23:52 +00:00
1 changed files with 5 additions and 2 deletions
Showing only changes of commit b820d6a674 - Show all commits

View File

@ -18,7 +18,8 @@ var _ = (fs.NodeReaddirer)((*ITNode)(nil))
// Readdir is part of the NodeReaddirer interface
func (n *ITNode) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno) {
if n.kind == 0 {
switch n.kind {
case 0:
// root folder
r := make([]fuse.DirEntry, 2)
r[0] = fuse.DirEntry{
@ -39,7 +40,9 @@ func (n *ITNode) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno) {
var _ = (fs.NodeLookuper)((*ITNode)(nil))
func (n *ITNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno) {
if n.kind == 0 {
switch n.kind {
case 0:
// root folder
if name == "device" {
stable := fs.StableAttr{
Mode: fuse.S_IFDIR,