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

Method metadata

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

Source from the content-addressed store, hash-verified

573 }
574
575 fn metadata(&self, path: &Path) -> Result<FileMetadata> {
576 if let Some(vf) = self.get_virtual_entry(path) {
577 return Ok(FileMetadata::new(!vf.is_dir, vf.is_dir, false));
578 }
579
580 if self.is_allowed(path) {
581 crate::perf::count(Counter::FsStatCalls, 1);
582 if let Ok(m) = self.physical.metadata(path) {
583 return Ok(FileMetadata::new(m.is_file(), m.is_dir(), m.is_symlink()));
584 }
585 }
586
587 // If direct lookup fails on both virtual and physical FS, check across rootDirs virtual merging
588 if let Some(resolved) = self.resolve_across_root_dirs(path) {
589 if let Some(vf) = self.get_virtual_entry(&resolved) {
590 return Ok(FileMetadata::new(!vf.is_dir, vf.is_dir, false));
591 }
592 crate::perf::count(Counter::FsStatCalls, 1);
593 if let Ok(m) = self.physical.metadata(&resolved) {
594 return Ok(FileMetadata::new(m.is_file(), m.is_dir(), m.is_symlink()));
595 }
596 }
597
598 Err(Error::from(std::io::ErrorKind::NotFound))
599 }
600
601 fn symlink_metadata(&self, path: &Path) -> Result<FileMetadata> {
602 // Fast path: check virtual files first (virtual files are never symlinks)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected