-
Notifications
You must be signed in to change notification settings - Fork 207
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
Implement an iofs.FS over the REAPI Tree proto #2955
Conversation
return nil, os.ErrNotExist | ||
} | ||
|
||
// openFile downloads a file from the CAS and returns it as an iofs.File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it returns it as an iofs.File
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah as in *file implements the iofs.File interface
src/remote/fs/fs.go
Outdated
func (fs *CASFileSystem) findNode(wd *pb.Directory, name string) (*pb.FileNode, *pb.DirectoryNode, *pb.SymlinkNode, error) { | ||
name, rest, hasToBeDir := strings.Cut(name, string(filepath.Separator)) | ||
// Must be a dodgy symlink that goes past our tree. | ||
if name == ".." || name == "." { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think "." should be ErrNotExist
src/remote/fs/fs.go
Outdated
mode: os.FileMode(file.NodeProperties.UnixMode.Value), | ||
// Technically we could calculate this on demand by allowing info.Size() to download the file from the | ||
// CAS... we don't need to for now though. | ||
size: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought the CAS stored the filesize without us needing to download it and calculated this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah! It's on the digest! Nice spot.
src/remote/fs/fs.go
Outdated
*info | ||
} | ||
|
||
// ReadDir is a slightly incorrect implementation of ReadDir. It deviates slightly as it will report all files have 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment should be updated now we have the filesize
No description provided.