Giter Site home page Giter Site logo

go-fuse-example's Introduction

Overview

This is an example of how to create a filesystem using memory-backed files. It implements all of the mechanics of a minimal, browseable, read-only filesystem.

Example Output

User console:

$ find /mnt/loop
/mnt/loop
/mnt/loop/subdirectory1
/mnt/loop/subdirectory1/file4
/mnt/loop/subdirectory1/file5
/mnt/loop/subdirectory1/file6
/mnt/loop/file1
/mnt/loop/file2
/mnt/loop/file3

$ ls -il /mnt/loop
total 0
  11 -rw-r--r-- 0 dustin dustin 16 Jul 10 14:19 file1
  22 -rw-r--r-- 0 dustin dustin 16 Jul 10 14:19 file2
  33 -rw-r--r-- 0 dustin dustin 16 Jul 10 14:19 file3
1002 drwxr-xr-x 0 dustin dustin 10 Jul 10 14:19 subdirectory1

$ cat /mnt/loop/file1
test content 1

$ cat /mnt/loop/subdirectory1/file4
test content 4

$ sudo umount /mnt/loop 

Server console:

$ go run main.go 
Unmount to terminate.

Opendir: [/]
Readdir: [/]
Lookup: [/subdirectory1]
Lookup: [/file1]
Lookup: [/file2]
Lookup: [/file3]
Opendir: [/subdirectory1]
Readdir: [/subdirectory1]
Lookup: [/subdirectory1/file4]
Lookup: [/subdirectory1/file5]
Lookup: [/subdirectory1/file6]
Opendir: [/]
Readdir: [/]
Lookup: [/subdirectory1]
Lookup: [/file1]
Lookup: [/file2]
Lookup: [/file3]
Lookup: [/file1]
Open (00000000000000001000000000000000): [/file1]
Lookup: [/file1]
Lookup: [/file1]
Lookup: [/subdirectory1]
Lookup: [/subdirectory1/file4]
Open (00000000000000001000000000000000): [/subdirectory1/file4]
Lookup: [/subdirectory1/file4]
Lookup: [/subdirectory1/file4]

$

go-fuse-example's People

Contributors

dsoprea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.