How to check if a file has been opened by another application in C++?

后端 未结 10 1841
耶瑟儿~
耶瑟儿~ 2020-12-02 01:55

I know, that there\'s the is_open() function in C++, but I want one program to check if a file hasn\'t been opened by another application. Is there any way to d

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 02:33

    There's a command-line too and API that have been added to the Linux kernel and do just that: inotify.

    Here's the man page.

提交回复
热议问题