rust/hg-core/src/vfs.rs
changeset 48345 d5a91701f7dc
parent 48199 9d0e5629cfbf
child 48417 5734b03ecf3e
--- a/rust/hg-core/src/vfs.rs	Tue Nov 23 19:40:29 2021 +0100
+++ b/rust/hg-core/src/vfs.rs	Tue Nov 23 20:04:22 2021 +0100
@@ -16,6 +16,22 @@
         self.base.join(relative_path)
     }
 
+    pub fn symlink_metadata(
+        &self,
+        relative_path: impl AsRef<Path>,
+    ) -> Result<std::fs::Metadata, HgError> {
+        let path = self.join(relative_path);
+        std::fs::symlink_metadata(&path).when_reading_file(&path)
+    }
+
+    pub fn read_link(
+        &self,
+        relative_path: impl AsRef<Path>,
+    ) -> Result<PathBuf, HgError> {
+        let path = self.join(relative_path);
+        std::fs::read_link(&path).when_reading_file(&path)
+    }
+
     pub fn read(
         &self,
         relative_path: impl AsRef<Path>,