Skip to content

binzume/dkango

Repository files navigation

Dokan bindings for Go

Build Status Go Reference license

This is a Go library to implement a user-mode file system on Windows using Dokan.

Usage

Install Dokan library

winget install dokan-dev.Dokany

API

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.

examples/simple/simple.go

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 {}
}

How to create a writable FS?

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.

License

MIT

About

Dokan bindings for Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages