Boost :: filesystem :: file_size error when using path with space

I request boost::filesystem::file_sizefor a file with a path "/tmp/test\ file.txt", and it does not report this file or directory when it is.

Error: fs::file_size("/tmp/test\ file.txt") reported boost::filesystem::file_size: No such file or directory
-rw-rw-r-- 1 rturrado users 12486 Mar 15 12:01 /tmp/test file.txt

Are there any considerations when using escaped paths in boost :: filesystem?

+3
source share
1 answer

Having completed this question, I fixed the problem thanks to the comments of Mat and ymett.

boost::filesystem::file_size("/tmp/test file.txt")works great. You do not need to run.

+6
source

All Articles