You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/05/16 19:49:53 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4231: Return NotFound for directories in Head and Get (#4230)

tustvold commented on code in PR #4231:
URL: https://github.com/apache/arrow-rs/pull/4231#discussion_r1195627652


##########
object_store/src/local.rs:
##########
@@ -878,19 +883,25 @@ fn read_range(file: &mut File, path: &PathBuf, range: Range<usize>) -> Result<By
 }
 
 fn open_file(path: &PathBuf) -> Result<File> {
-    let file = File::open(path).map_err(|e| {
-        if e.kind() == std::io::ErrorKind::NotFound {
-            Error::NotFound {
+    let file = match File::open(path).and_then(|f| Ok((f.metadata()?, f))) {

Review Comment:
   This is potentially slightly unfortunate, in that we require an additional syscall, but I couldn't find a mechanism to only open files



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org