Skip to content

Os::FileSystem::getPathType not detecting directories #3519

@LeStarch

Description

@LeStarch

Discussed in #3516

Originally posted by LornDMiller April 18, 2025
I'm trying to use Os::FileSystem::getPathType to determine if a path is a directory and it's constantly telling me it's a file even though I know it's a directory. I traced this back through the code and saw that it was ultimately doing an "open" on the path (fprime/Os/Posix/File.cpp, line 86) and if that succeeded, calling the path a file.

I did a quick C test program on the same machine, Ubuntu 22.04.5, and saw that the open call does in fact return a valid file descriptor (in my case, 3) and leaves errno set to 0 when attempting to open a directory.

Is this something that's just broken in FPrime? Is this something I need to examine more thoroughly or is this a potential bug report? Am I missing a compiler flag somewhere?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions