I want to use flock(int fd, int operation)
on opened file, but flock()
is c
function. How to get int fd
from std::ofstream outfile
to use as argument for flock()
.
ps. I want int fd
at c++
style, I know that I can open file in c
style and get it. The question is about c++ and flock()
std::ofstream outfile;
outfile.open ( LOCKFILE, std::ios_base::trunc);
thanks