From 080654aaf9bd2f94d634008afd1dc26c74752eec Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 25 Jun 2024 20:37:43 +0300 Subject: feat(tvix/eval): add file_type method This allows peeking of the type at a given path. It's necessary, as an open() might not fail until you try to read() from it, and generally, stat'ing can be faster in some cases. Change-Id: Ib002da3194a3546ca286de49aac8d1022ec5560f Reviewed-on: https://cl.tvl.fyi/c/depot/+/11871 Tested-by: BuildkiteCI Reviewed-by: Ilan Joselevich Reviewed-by: Connor Brewster --- tvix/glue/src/tvix_io.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix/glue/src/tvix_io.rs') diff --git a/tvix/glue/src/tvix_io.rs b/tvix/glue/src/tvix_io.rs index 0e5f23b99093..db0c2cef77aa 100644 --- a/tvix/glue/src/tvix_io.rs +++ b/tvix/glue/src/tvix_io.rs @@ -60,6 +60,10 @@ where self.actual.as_ref().open(path) } + fn file_type(&self, path: &Path) -> io::Result { + self.actual.as_ref().file_type(path) + } + fn read_dir(&self, path: &Path) -> io::Result> { self.actual.as_ref().read_dir(path) } -- cgit 1.4.1