{"id":15914445,"url":"https://github.com/bbengfort/mirrorfs","last_synced_at":"2025-04-03T03:27:36.323Z","repository":{"id":69222747,"uuid":"109893823","full_name":"bbengfort/mirrorfs","owner":"bbengfort","description":"A simple FUSE file system that mirrors operations from the mounted directory to another directory.","archived":false,"fork":false,"pushed_at":"2017-11-09T12:58:58.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T17:30:52.819Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbengfort.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-07T21:37:06.000Z","updated_at":"2023-04-05T02:45:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"50ddb50f-948d-41ae-911a-3c20474fa831","html_url":"https://github.com/bbengfort/mirrorfs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fmirrorfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fmirrorfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fmirrorfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbengfort%2Fmirrorfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbengfort","download_url":"https://codeload.github.com/bbengfort/mirrorfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246930768,"owners_count":20856684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T17:02:57.276Z","updated_at":"2025-04-03T03:27:36.298Z","avatar_url":"https://github.com/bbengfort.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MirrorFS\n\n**A simple FUSE file system that mirrors operations from the mounted directory to another directory.**\n\n## Usage\n\nClone the repository into your `$GOPATH` or install as follows:\n\n```\n$ go get github.com/bbengfort/...\n```\n\nIf you've run `go install` (by default with `go get`) then you should have the `mirrorfs` command:\n\n```\n$ mirrorfs mount path/to/mount path/to/mirror\n```\n\nAll operations in `path/to/mount` will be mirrored to `path/to/mirror` and vice-versa.\n\n\n## Fuse Implementation\n\nThe `bazil.org/fuse` implementation has many interfaces for various FUSE requests and responses that may overlap. For example `ReadAll` will supersede `Read` if implemented ([`serve.go L1228`](https://github.com/bazil/fuse/blob/371fbbdaa8987b715bdd21d6adc4c9b20155f748/fs/serve.go#L1228)). A full inspection of the [`handleRequest`](https://github.com/bazil/fuse/blob/371fbbdaa8987b715bdd21d6adc4c9b20155f748/fs/serve.go#L907) method is required to understand the full FUSE response handling by the Bazil implementation.\n\nMirrorFS implements the following methods/interfaces:\n\n- `(*FileSystem) Root() (fusefs.Node, error)`\n- `(*Node) Attr(ctx context.Context, attr *fuse.Attr) error`\n- `(*Node) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error`\n- `(*Node) Lookup(ctx context.Context, name string) (fusefs.Node, error)`\n- `(*Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)`\n- `(*Node) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fusefs.Node, error)`\n- `(*Node) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fs.Node, fs.Handle, error)`\n- `(*Node) Remove(ctx context.Context, req *fuse.RemoveRequest) error`\n- `(*Node) Rename(ctx context.Context, req *fuse.RenameRequest, newDir fusefs.Node) error`\n- `(*Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error`\n- `(*Node) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error`\n- `(*Node) Fsync(ctx context.Context, req *fuse.FsyncRequest) error`\n- `(*Node) Flush(ctx context.Context, req *fuse.FlushRequest) error`\n- `(*Node) Release(ctx context.Context, req *fuse.ReleaseRequest) error`\n\n### Notes\n\n- If `Getattr` is not implemented will use `Attr` and fill in zero values.\n- `Setattr` is used to communicate changes to a file size, e.g. truncate.\n- `Create` creates and opens a file handle; the node is also used as a handle since it has an open reference to the file object in mirror.\n- If `Open` is not implemented it will always succeed and the node itself will be returned as the handle. \n- `Fsync` is a low level op, telling the OS to flush its buffers to physical media. `Flush` tells an application to flush its internal buffers out to the OS.\n\n### Reference\n\nThis section contains a complete listing of interfaces that can be implemented by a bazil.org/fuse application. Note that syscall error numbers can be found [here](https://gist.github.com/bbengfort/cb0f999284a42ee993bb8cbdc1e0dfec).\n\n#### FS Interfaces\n\n- `Root() (Node, error)`\n- `Destroy()`\n- `GenerateInode(parentInode uint64, name string) uint64`\n- `Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) error`\n\n#### Node Interfaces\n\n- `Attr(ctx context.Context, attr *fuse.Attr) error`\n- `Access(ctx context.Context, req *fuse.AccessRequest) error`\n- `Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (Node, Handle, error)`\n- `Forget()`\n- `Fsync(ctx context.Context, req *fuse.FsyncRequest) error`\n- `Getattr(ctx context.Context, req *fuse.GetattrRequest, resp *fuse.GetattrResponse) error`\n- `Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp *fuse.GetxattrResponse) error`\n- `Link(ctx context.Context, req *fuse.LinkRequest, old Node) (Node, error)`\n- `Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp *fuse.ListxattrResponse) error`\n- `Mkdir(ctx context.Context, req *fuse.MkdirRequest) (Node, error)`\n- `Mknod(ctx context.Context, req *fuse.MknodRequest) (Node, error)`\n- `Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (Handle, error)`\n- `Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string, error)`\n- `Remove(ctx context.Context, req *fuse.RemoveRequest) error`\n- `Removexattr(ctx context.Context, req *fuse.RemovexattrRequest) error`\n- `Rename(ctx context.Context, req *fuse.RenameRequest, newDir Node) error`\n- `Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (Node, error)`\n- `Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) error`\n- `Setxattr(ctx context.Context, req *fuse.SetxattrRequest) error`\n- `Lookup(ctx context.Context, name string) (Node, error)`\n- `Symlink(ctx context.Context, req *fuse.SymlinkRequest) (Node, error)`\n\n#### Handle Interfaces\n\n- `Flush(ctx context.Context, req *fuse.FlushRequest) error`\n- `ReadAll(ctx context.Context) ([]byte, error)`\n- `ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)`\n- `Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error`\n- `Release(ctx context.Context, req *fuse.ReleaseRequest) error`\n- `Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbengfort%2Fmirrorfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbengfort%2Fmirrorfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbengfort%2Fmirrorfs/lists"}