I have a file name as a std::string
that is comprised of a file and path, and I want to rename the file, but keep the extension the same.
As an example change abc to ijk:
/dir1/dir2/dir3/abc.txt ---> /dir1/dir2/dir3/ijk.txt
../../dir1/abc.txt ---> ../../dir1/ijk.txt
I know this can be done using some kind of string processing, but I'd like to use the std::filesystem path as it handles all the edge cases.
Is there a way to do this with the std::filesystem
path facilities?