Follow symlinks when looking for disc images (#78)

This commit is contained in:
cadmic 2024-10-17 23:37:54 -07:00 committed by GitHub
parent fa5068fd6d
commit 8823c2225e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -2067,7 +2067,8 @@ pub fn find_object_base(config: &ProjectConfig) -> Result<ObjectBase> {
// Search for disc images in the object base directory // Search for disc images in the object base directory
for result in fs::read_dir(&base)? { for result in fs::read_dir(&base)? {
let entry = result?; let entry = result?;
if entry.file_type()?.is_file() { // Use fs::metadata to follow symlinks
if fs::metadata(entry.path())?.file_type().is_file() {
let path = check_path_buf(entry.path())?; let path = check_path_buf(entry.path())?;
let mut file = open_file(&path, false)?; let mut file = open_file(&path, false)?;
let format = nodtool::nod::Disc::detect(file.as_mut())?; let format = nodtool::nod::Disc::detect(file.as_mut())?;