Open YaqiWang opened 2 years ago
We can mess around with this, but the correct solution is in https://github.com/idaholab/moose/pull/21137 . std::filesystem::path
can perform this sort of normalization.
How likely that PR can be merged? Otherwise, I can push up a quick fix. It does not cost me much.
yeah, you should go with the fix. std::filesystem is still a bit out, as it required more modern minimal compiler targets.
Reason
I am seeing something like
moose/framework/data/../../share/moose/framework/data/../../../foo
during accessing a file.Design
We can simply improve
MooseUtils::pathjoin
a little to get rid of this and make the screen output sane. The improvement should also protect potential bad access likemoose/framework/../../../../../../../../../foo
.Impact
Better code and should not impact current capabilities.