I am trying to open a file in append mode using the open () api call, however the following code does not work! It does not write anything to the file! here is my code:
O_APPENDis not in itself; this is a flag. Since the value O_RDONLYis 0, it looks like you are trying to open the file read-only, but to add, which is nonsense. Use O_WRONLY|O_APPENDor O_RDWR|O_APPEND.
O_APPEND
O_RDONLY
O_WRONLY|O_APPEND
O_RDWR|O_APPEND