开发者

Directories created by boost::filesystem::create_directories() not immediately accessible?

开发者 https://www.devze.com 2023-03-29 10:27 出处:网络
I am using boost::filesystem::create_directories() to create new directories. When I try to access these directories shortly after creation, I get an error saying: no such directory. But if I sleep fo

I am using boost::filesystem::create_directories() to create new directories. When I try to access these directories shortly after creation, I get an error saying: no such directory. But if I sleep for a wh开发者_开发技巧ile after creating directories everything is fine (I do not get the error). Also, I tried using fsync() and sync() after creating directories but it made no difference. I am testing it on ext4 and xfs file systems and my boost version is boost 1.44

My questions are

  1. Does boost::create_directories() create directories instantly? Or is it possible that something is wrong there?
  2. Also, are sync() and fsync() guaranteed to flush everything to disc on ext4/xfs?
0

精彩评论

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