
8 Jan
2012
8 Jan
'12
1:02 p.m.
Le 08/01/2012 07:50, Mike Frysinger a écrit :
On Thursday 05 January 2012 13:44:56 David Wagner wrote:
bin_fd = creat(bin_filename, S_IRUSR | S_IWUSR | S_IRGRP |
S_IWGRP);
this should prob be open() -mike
What is wrong with creat() ? from 'man 2 creat': creat() is equivalent to open() with flags equal to O_CREAT|O_WRONLY|O_TRUNC. We want to create the file if it doesn't exist and truncate it if it does.
The only issue I can think of is that no additional flag can be passed to creat(); fcntl can alter some of them. But will we need any ?
Regards, David.