This is a Go library to implement a user-mode file system on Windows using Dokan.
- Depends only on the Dokan library (No cgo)
- io/fs.FS interface support
- Implemented as a backend for https://github.com/binzume/fsmount (cross platform)
winget install dokan-dev.Dokany
The only recommended interface is dkango.MountFS(mountPoint, fsys, options)
. You can add your file system to Windows with a few lines of code.
dokan package provides the low-level API for Dokan, but it is not yet a stable interface. Small breaking changes will be made in the future without any notice.
package main
import (
"os"
"github.com/binzume/dkango"
)
func main() {
mount, err := dkango.MountFS("X:", os.DirFS("."), nil)
if err != nil {
panic(err)
}
defer mount.Close()
// Block forever
select {}
}
See examples/writable/writable.go
go run ./examples/writable testdir R:
type OpenWriterFS interface {
fs.FS
OpenWriter(name string, flag int) (io.WriteCloser, error)
}
Other interfaces such as RemoveFS, MkdirFS, RenameFS... are also available.
MIT