atomic create file if not exists from bash script

前端 未结 6 1643
盖世英雄少女心
盖世英雄少女心 2020-12-15 22:24

In system call open(), if I open with O_CREAT | O_EXCL, the system call ensures that the file will only be created if it does not exist. The atomic

6条回答
  •  抹茶落季
    2020-12-15 22:55

    touch is the command you are looking for. It updates timestamps of the provided file if the file exists or creates it if it doesn't.

提交回复
热议问题