开发者

Opening file in Append mode : using open() API

开发者 https://www.devze.com 2023-03-29 08:05 出处:网络
i am trying to open a file in append mode using open() api call , how开发者_开发问答ever following code is not working ! Its not writing anything to file! here is my code :

i am trying to open a file in append mode using open() api call , how开发者_开发问答ever following code is not working ! Its not writing anything to file! here is my code :

Opening file in Append mode : using open() API


O_APPEND is not a mode by itself; it's a flag. Since the value of O_RDONLY is 0, it's like you're trying to open the file read-only but for append, which is nonsense. Use O_WRONLY|O_APPEND or O_RDWR|O_APPEND.

0

精彩评论

暂无评论...
验证码 换一张
取 消