开发者

boost::filesystem::file_size error when using a path with whitespace

I'm asking boost::filesystem::file_size for a file with path开发者_如何学Python "/tmp/test\ file.txt", and it reports no such file or directory when it is there.

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 paths with escaped sequences in boost::filesystem?


Closing this question, as I fixed the issue thanks to Mat and ymett comments.

boost::filesystem::file_size("/tmp/test file.txt") works just fine. You don't need any escaping.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜