开发者

Opening file in Append mode : using open() API

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜