如何检查文件是否已由C ++中的另一个应用程序打开? [英] How to check if a file has been opened by another application in C++?
本文介绍了如何检查文件是否已由C ++中的另一个应用程序打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道,在C ++中有 is_open()
函数,但我想要一个程序来检查一个文件是否没有被另一个应用程序打开。使用标准库有什么办法吗?
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 do it using standard library?
EDIT - 在解答这是Linux应用程序的答案。
EDIT - Clarified in the answers that this is for a Linux application.
推荐答案
不,标准库没有这样的功能。
No, the standard library has no such functionality.
这篇关于如何检查文件是否已由C ++中的另一个应用程序打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文