+
Skip to content

erofs/go-erofs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-erofs

A Go library for opening erofs files as a Go stdlib fs.FS.

Scope

This library is designed to allow erofs files to be usable in any Go operation that uses the standard filesystem interface. This could be useful for accessing an erofs file just as you would a plain directory without needing to unpack. In the future this library could provide an interface to create erofs files as well.

Current state

  • Read erofs files created with default mkfs.erofs options
  • Read chunk-based erofs files (without indexes)
  • Xattr support
  • Read erofs files with compression
  • Extra devices for chunked data and chunk indexes
  • Creating erofs files

Example use

Print out all the files in an erofs file

package main

import (
	"fmt"
	"io/fs"
	"log"
	"os"

	"github.com/erofs/go-erofs"
)

func main() {
	f, err := os.Open("testdata/basic-default.erofs")
	if err != nil {
		log.Fatal(err)
	}
	defer f.Close()

	img, err := erofs.EroFS(f)
	if err != nil {
		log.Fatal(err)
	}

	fs.WalkDir(img, "/", func(path string, entry fs.DirEntry, err error) error {
		fmt.Println(path)
		return nil
	})
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载