CreateFile CREATE_NEW equivalent on linux
问题 I wrote a method which tries to create a file. However I set the flag CREATE_NEW so it can only create it when it doesnt exist. It looks like this: for (;;) { handle_ = CreateFileA(filePath.c_str(), 0, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_HIDDEN | FILE_FLAG_DELETE_ON_CLOSE, NULL); if (handle_ != INVALID_HANDLE_VALUE) break; boost::this_thread::sleep(boost::posix_time::millisec(10)); } This works as it should. Now I want to port it to linux and and of course the CreateFile function are only for