Create a locked file with boost::interprocess::file_lock
问题 I'd like to use boost::interprocess::file_lock to ensure that files that are written to a directory x by process P1 are not read by process P2 until they are complete. To do this, I'd like to have P1 lock the files with boost::interprocess::file_lock while it's writing them, and then unlock them when it's done. Then P2 can just skip over (and come back to) any files that are locked. The problem I'm having is that it appears that boost::interprocess::file_lock only lets you lock files that