Skip to content
/ memfs Public

The memfs package is an in memory filesystem for go.

License

Notifications You must be signed in to change notification settings

absfs/memfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

memfs - In Memory File System

The memfs package implements the absfs.FileSystem interface as a RAM backed filesystem.

Care has been taken to insure that memfs returns identical errors both in text and type as the os package. This makes memfs particularly suited for use in testing.

Install

$ go get github.com/absfs/memfs

Example Usage

package main

import(
    "fmt"
    "os"

    "github.com/absfs/memfs"
)

func main() {
    fs, _ := memfs.NewFS() // remember kids don't ignore errors

    // Opens a file with read/write permissions in the current directory
    f, _ := fs.Create("/example.txt")

    f.Write([]byte("Hello, world!"))
    f.Close()

    fs.Remove("example.txt")
}

absfs

Check out the absfs repo for more information about the abstract filesystem interface and features like filesystem composition

LICENSE

This project is governed by the MIT License. See LICENSE

About

The memfs package is an in memory filesystem for go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages