MCPcopy Create free account
hub / github.com/angular/angular / symlink_metadata

Method symlink_metadata

packages/compiler-cli/preprocessor/ng-analyze/src/fs.rs:601–626  ·  view source on GitHub ↗
(&self, path: &Path)

Source from the content-addressed store, hash-verified

599 }
600
601 fn symlink_metadata(&self, path: &Path) -> Result<FileMetadata> {
602 // Fast path: check virtual files first (virtual files are never symlinks)
603 if let Some(vf) = self.get_virtual_entry(path) {
604 return Ok(FileMetadata::new(!vf.is_dir, vf.is_dir, false));
605 }
606
607 if self.is_allowed(path) {
608 crate::perf::count(Counter::FsStatCalls, 1);
609 if let Ok(m) = self.physical.symlink_metadata(path) {
610 return Ok(FileMetadata::new(m.is_file(), m.is_dir(), m.is_symlink()));
611 }
612 }
613
614 // If direct lookup fails on both virtual and physical FS, check across rootDirs virtual merging
615 if let Some(resolved) = self.resolve_across_root_dirs(path) {
616 if let Some(vf) = self.get_virtual_entry(&resolved) {
617 return Ok(FileMetadata::new(!vf.is_dir, vf.is_dir, false));
618 }
619 crate::perf::count(Counter::FsStatCalls, 1);
620 if let Ok(m) = self.physical.symlink_metadata(&resolved) {
621 return Ok(FileMetadata::new(m.is_file(), m.is_dir(), m.is_symlink()));
622 }
623 }
624
625 Err(Error::from(std::io::ErrorKind::NotFound))
626 }
627
628 fn read_link(&self, path: &Path) -> std::result::Result<PathBuf, ResolveError> {
629 // Virtual filesystem doesn't support symlinks; if a virtual file exists here, it's not a symlink.

Callers

nothing calls this directly

Calls 6

get_virtual_entryMethod · 0.80
is_allowedMethod · 0.80
is_fileMethod · 0.80
is_dirMethod · 0.80
countFunction · 0.50

Tested by

no test coverage detected