15

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 while 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?
maxschlepzig
  • 35,645
  • 14
  • 145
  • 182
polapts
  • 5,493
  • 10
  • 37
  • 49

0 Answers0