fs: move ToNamespacedPath dir calls to c++
#53630
Merged
ToNamespacedPath dir calls to c++
#53630