I open a file using the system call open().
if ((fd2 = open(logFile, O_RDWR |O_APPEND | O_CREAT ), 0666) == -1)
DieWithError("open() failed");
My file which is FTP_track.log is created without any problem. The problem is although i have mode 0666, which is read and write for all, I can not open the file in unix. I have to change permissions from the file’s properties to read and write.
Any ideas? Thank you.
The problem with your line is that the parenthesis don’t match up. Your expression is parsed as
fd2 = open(), 0666. In C the expressionexpr1, expr2has the valueexpr2so yourifstatement basically saysfd2 = 0666.