안녕하세요.
fcntl() 함수를 공부하다가 이해가 안되는 부분이 있어서...
file_status 에 분명히 아래와 같이 초기값을 줬는데 왜 결과가
다르게 나오는지 잘 모르겠습니다. 컴파일 가능한 짧은 소스를
올립니다.
[code:1]#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
static void check_file( int );
static int file_status = O_RDONLY | O_CREAT | O_TRUNC;
int main( void )
{
int fd;
fd = open( "fcntl_test.temp", file_status, 00644 );