Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFS File vs Directory #5094

Closed
schomatis opened this issue Jun 7, 2018 · 1 comment
Closed

MFS File vs Directory #5094

schomatis opened this issue Jun 7, 2018 · 1 comment
Assignees
Labels
topic/docs-ipfs Topic docs-ipfs topic/files Topic files

Comments

@schomatis
Copy link
Contributor

At this point I'm pretty sure the MFS Root structure can be refactored out (#5066) so I would like to concentrate on abstracting the common characteristics of the Directory and File structures, which are many: parent, name, dserv, lock/nodelk, maybe node (in the directory it is hidden behind the dirbuilder which could maybe also be refactored out #5084). What those two structures should reflect is only what makes a file different from a directory in an MFS context: a file has content that can be modified and a directory has (what could also be denominated as content) entries (links) of other files and directories.

https://github.com/ipfs/go-ipfs/blob/7853e53860805e08a212d78c4baa5d59bff99ba8/mfs/dir.go#L26-L41

https://github.com/ipfs/go-ipfs/blob/fc05376e94125b854e2b837760c44aacbaa97e2d/mfs/file.go#L16-L28

What I would like to discuss is how to encapsulate that common functionality, could we adopt the Unix terminology of a file that can be a directory or a regular file? (which I never really liked as the file term ends up carrying too much conflicting meaning, but can't think of anything else)

@schomatis schomatis added topic/docs-ipfs Topic docs-ipfs topic/files Topic files labels Jun 7, 2018
@schomatis schomatis added this to the Files API Documentation milestone Jun 7, 2018
@schomatis schomatis self-assigned this Jun 7, 2018
@whyrusleeping
Copy link
Member

The 'common' stuff could proabably be thought of as an inode. In general, +1 to this

@ghost ghost added the status/in-progress In progress label Jul 3, 2018
@ghost ghost removed the status/in-progress In progress label Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/docs-ipfs Topic docs-ipfs topic/files Topic files
Projects
None yet
Development

No branches or pull requests

2 participants