Matheus Sampaio Queiroga a1a726eb4d
All checks were successful
Fuse test / go-test (push) Successful in 22s
Implement Lseek operation, and enhance error handling
- Update the FileSystemHost to remove functions SetCapCaseInsensitive, SetCapReaddirPlus, SetCapDeleteAccess, SetCapOpenTrunc, SetDirectIO, SetUseIno and expose CapCaseInsensitive, CapReaddirPlus, CapDeleteAccess, CapOpenTrunc, DirectIO, UseIno
- Added `FileSystemLseek` interface to support Lseek operation in FUSE.
- Implemented Lseek functionality in the host layer.
- Refactored error handling in `ErrorToStatus` to improve clarity and coverage.
- Enhanced `BasicStat` and `AppendDirEntry` functions to populate additional fields in the FUSE stat structure.
- Created utility functions for managing FUSE flags and permissions.
- fs:
  - Remove `Fd() uintptr` from base of File interface
  - Now fs use internal File Descriptor
  - Removed `FS() F` from `FileSystemMount[T, FileSystem[T]]`
- Unix fs:
  - Merge `_fuse` to `_FileSystemMount` and rename to FuseFs
  - Add new `FileSystemStatFst` to use direct fuse Statfs struct
  - Utimens don't return -ENOSYS if FileSystemUtimens not implemented
  - Add `Lseek` function

Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
2025-08-10 17:27:52 -03:00
2025-07-21 00:21:22 -03:00
2025-07-24 00:31:28 -03:00
2025-07-21 00:21:22 -03:00
2025-07-21 00:21:22 -03:00
2025-07-21 00:21:22 -03:00
2025-07-21 00:21:22 -03:00

Cgofuse

Cgofuse is a cross-platform Go binding for FUSE (Filesystem in Userspace). It allows you to develop user-mode filesystems in Go that can be mounted on Linux, macOS, Windows, FreeBSD, NetBSD, and OpenBSD.

Features

  • FUSE 3 Support: Opt-in support for FUSE 3 features on Linux and FreeBSD by using the fuse3 build tag.
  • Cross-Platform: Works on a wide range of operating systems.
    • Linux: FUSE 2 and FUSE 3.
    • macOS: macFUSE.
    • Windows: WinFsp.
    • FreeBSD: FUSE 2 and FUSE 3.
    • NetBSD: librefuse.
    • OpenBSD: FUSE.
cgo !cgo FUSE FUSE3
Windows - - Winfsp
macOS
Linux
FreeBSD
NetBSD
OpenBSD

Prerequisites

Before using Cgofuse, you need to install Go, a C compiler, and the FUSE development libraries for your operating system.

Linux

For FUSE 2:

  • Debian/Ubuntu: sudo apt-get install build-essential libfuse-dev
  • Fedora/RHEL: sudo dnf install fuse-devel
  • Arch: sudo pacman -Sy fuse

For FUSE 3:

  • Debian/Ubuntu: sudo apt-get install build-essential libfuse3-dev
  • Fedora/RHEL: sudo dnf install fuse3-devel
  • Arch: sudo pacman -Sy fuse3

macOS

Install macFUSE and Command Line Tools.

brew install --cask macfuse

Windows

Just need WinfSP installed, no require copiler, as DLL is used directly.

Manual installtion: Download Winget: winget install WinFsp.WinFsp

FreeBSD

  • For FUSE 2: pkg install fusefs-libs
  • For FUSE 3: pkg install fusefs-libs3

NetBSD

  • pkgin install librefuse

OpenBSD

The fuse library is included in the base system, but you will need a compiler.

Build fuse3

To use FUSE 3 on supported platforms (Linux, FreeBSD), use the fuse3 build tag:

go build -tags fuse3

Usage

get go module

go get -u sirherobrine23.com.br/Sirherobrine23/cgofuse

fs (recomend)

fs implements and manages a file system based on the os and syscall go, it is much faster to implement because it is not necessary to use direction fuse or winfsp

License

Cgofuse is licensed under the MIT License. See the LICENSE file for details.

Original author is Bill Zissimopoulos (Winfsp).

Description
Cross-platform FUSE library for Go - Works on Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD
Readme MIT 706 KiB
Languages
Go 99.5%
Shell 0.5%