Directories created by boost::filesystem::create_directories() not immediately accessible?
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
- Does
boost::create_directories()
create directories instantly? Or is it possible that something is wrong there? - Also, are
sync()
andfsync()
guaranteed to flush everything to disc on ext4/xfs?
精彩评论