Go: os: Consider providing a VFS layer

Created on 5 Jun 2013  路  12Comments  路  Source: golang/go

We have various different VFS layers in different programs, such as
cmd/godoc/filesystem.go.  Can we have the os package provide a VFS layer?  Or can we
provide a vfs package that wraps the os package?  Or something else to provide a simple
unified approach?
Thinking

Most helpful comment

@robpike and I worked out a design for a general file system interface for Go. I've posted a draft design doc, video, and code (links below). Instead of comments on this issue, please use the Reddit Q&A for comments on this specific draft design - Reddit threads and scales discussions better than GitHub does. Thanks!

Video: https://golang.org/s/draft-iofs-video
Design: https://golang.org/s/draft-iofs-design
Q&A: https://golang.org/s/draft-iofs-reddit
Code: https://golang.org/s/draft-iofs-code

All 12 comments

Comment 1:

_Labels changed: added go1.2maybe._

Comment 2 by [email protected]:

Well, it's very much a skeleton at the moment, but I've started brainstorm-implementing
a vfs type layer here:
https://github.com/tvierling/go-vfs
The basic planned structure is for two types of accessibility: an iterable-only,
sequential-access interface (脿 la most archives), and a random-path-access filesystem
that implements and extends the above with a full complement of operations (applicable
to real filesystems, as well as virtual accessors that support path-type operations...
say, URIs or anything else that can be structured as a path tree).
Not too sure where I'm going with it yet, but I'm open to ideas thrown in as issues on
the github repo.

Comment 3:

For interest's sake, the godoc VFS stuff has been put into a separate package:
 https://code.google.com/p/go/source/browse/?repo=tools#hg%2Fgodoc%2Fvfs

Comment 4:

Since no proposal has been forthcoming, I suspect this is going to have to wait another
round.

_Labels changed: added go1.3maybe, removed go1.2maybe._

Comment 5:

_Labels changed: removed go1.3maybe._

Comment 6:

_Labels changed: added go1.3maybe._

Comment 7:

_Labels changed: added release-none, removed go1.3maybe._

Comment 8:

_Labels changed: added repo-main._

Comment 9:

This is tricky. We could never find a good design that worked with (replaced) all the
existing VFSes.

_Owner changed to ---._

_Status changed to Thinking._

Comment 10:

_Issue #8931 has been merged into this issue._

@robpike and I worked out a design for a general file system interface for Go. I've posted a draft design doc, video, and code (links below). Instead of comments on this issue, please use the Reddit Q&A for comments on this specific draft design - Reddit threads and scales discussions better than GitHub does. Thanks!

Video: https://golang.org/s/draft-iofs-video
Design: https://golang.org/s/draft-iofs-design
Q&A: https://golang.org/s/draft-iofs-reddit
Code: https://golang.org/s/draft-iofs-code

I've filed #41190 to propose accepting the draft design mentioned in my previous comment.
I am going to close this issue as superseded by that one.

Was this page helpful?
0 / 5 - 0 ratings