Possible Duplicate:
Getting a FILE* from a std::fstream
I need access to the file descriptor so that I can use the flock() (or fcntl(), I don't care) system call to create and release advisory file locks. But I couldn't see any way to get at it. Nor any alternative approaches that didn't smell of a horrible hack.
Any suggestion? Am I missing an obvious way to implement file locking?