Using the open() system call

前端 未结 5 1821
说谎
说谎 2020-12-17 17:11

I\'m writing a program that writes output to a file. If this file doesn\'t exist, I want to create it.

Currently, I\'m using the following flags when calling open: O

5条回答
  •  佛祖请我去吃肉
    2020-12-17 17:54

    Note that under POSIX (Unix, Linux, MacOS, etc) you can open and create a file with any permissions you choose, including 0 (no permission for anyone), and yet still write to the file if opened for writing.

提交回复
热议问题