C-Loftus commented on code in PR #1350:
URL: https://github.com/apache/iceberg-go/pull/1350#discussion_r3529397482


##########
io/gocloud/blob.go:
##########
@@ -256,10 +317,178 @@ func (bfs *blobFileIO) DeleteFiles(ctx context.Context, 
paths []string) ([]strin
        return deleted, errs
 }
 
+// MkdirAll mimics creating a directory by creating a zero-length object for 
each component of the path
+func (bfs *BlobFileIO) MkdirAll(path string) error {
+       key, err := bfs.preprocess(path)
+       if err != nil {
+               return &fs.PathError{Op: "mkdir", Path: path, Err: err}
+       }
+
+       key = strings.Trim(key, "/")
+       if key == "" || key == "." {
+               return nil
+       }
+
+       parts := strings.Split(key, "/")
+       for idx := range parts {
+               marker := strings.Join(parts[:idx+1], "/") + "/"
+               if err := bfs.WriteAll(bfs.ctx, marker, nil, nil); err != nil {
+                       return &fs.PathError{Op: "mkdir", Path: path, Err: err}
+               }
+       }
+
+       return nil
+}
+
+// ReadFile reads the contents of the file at the given path and returns it as 
a byte slice.
+func (bfs *BlobFileIO) ReadFile(path string) ([]byte, error) {
+       key, err := bfs.preprocess(path)
+       if err != nil {
+               return nil, &fs.PathError{Op: "ReadFile", Path: path, Err: err}
+       }
+
+       data, err := bfs.ReadAll(bfs.ctx, key)
+       if err != nil {
+               return nil, blobErrToFsErr("ReadFile", path, err)
+       }
+
+       return data, nil
+}
+
+// Stat interprets the input path as a directory or file and returns the 
corresponding FileInfo.
+// If the path does not exist, it returns fs.ErrNotExist
+func (bfs *BlobFileIO) Stat(path string) (fs.FileInfo, error) {

Review Comment:
   Addressed this in 
https://github.com/apache/iceberg-go/pull/1350/commits/58c4d690d17e332d8b8185fcb5e4a1d50c312d9f
 Let me know if that seems ok, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to