pluto icon indicating copy to clipboard operation
pluto copied to clipboard

VFS directory listing

Open SamTebbs33 opened this issue 4 years ago • 2 comments

The virtual filesystem should support listing the children of directories. Slices may be useful for this.

SamTebbs33 avatar Jul 21 '20 17:07 SamTebbs33

Should this be a part of the FileSystem struct or the DirNode struct? What would make more sense? Also, I don't know if slices are the best for this. I think some filesystems use linked-lists to specify directory entries, so maybe some sort of an iterator would be more convenient for this.

iamgweej avatar Aug 28 '20 21:08 iamgweej

I think it should be part of DirNode since it makes sense to have to open the dir in order to list its children. It's also nice to encapsulate operations on nodes within the node struct itself. With regards to slices vs lists, whatever makes for a cleaner implementation and uses least memory is what we should go for, IMO. Slices can be iterated upon and lists can be converted to a slice with toOwnedSlice (last time I checked!).

SamTebbs33 avatar Aug 29 '20 14:08 SamTebbs33