Skip to content

Conversation

@vincewoo
Copy link
Collaborator

Related Issue(s) #3519
Has Unit Tests (y/n) y
Documentation Included (y/n) n

Change Description

Fix directory detection in Os::FileSystem::getPathType. The new code is relying on standard POSIX features stat(), S_ISDIR, and S_ISREG for detection instead of trying to open.

Rationale

This fixes a bug that incorrectly detects a directory as a regular file.

Testing/Review Recommendations

New UT, DetectDirectory, added to FileSystemRules that test the following cases.

Future Work

None

@vincewoo vincewoo requested review from LeStarch and thomas-bc June 13, 2025 05:19
@thomas-bc thomas-bc changed the title Fixing directory detection bug in Os::FileSystem::getPathType Fix directory detection bug in Os::FileSystem::getPathType Jun 16, 2025
Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@thomas-bc
Copy link
Collaborator

Labeling this so we remember to mention the new implementation-specific function in the release notes

@thomas-bc thomas-bc added the Breaking Changes / Needs Release Notes Need to add instructions in the release notes for updates. label Jun 16, 2025
@LeStarch LeStarch merged commit 20d1b54 into nasa:devel Jun 16, 2025
47 checks passed
@vincewoo vincewoo deleted the FP-3519 branch August 6, 2025 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Changes / Needs Release Notes Need to add instructions in the release notes for updates.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants