How to check path in boost :: filesystem?

I install boost::filesystem::path from the edit box. I notice that the constructor is happy to accept invalid characters for the file name.

How can I use boost::filesystem to check if boost::filesystem::path valid file name?

+6
source share
2 answers

Look at here:

http://www.boost.org/doc/libs/release/libs/filesystem/doc/portability_guide.htm

Various functions for verifying file names are described here.

+5
source

What about relative file paths?

boost :: filesystem :: windows_name ("directory / file.txt") returns false.

How can I check this? My target OS is Linux, and the target drive is a USB drive. Stick files can be used by Windows users.

0
source

Source: https://habr.com/ru/post/914785/


All Articles