foo*_*o_l 4 c linux filesystems
我有生成的核心文件,其pid附加到其名称或有时只有名称核心.我需要检查文件是否存在名称core.pid或core.我尝试使用stat()路径字符串的地方/tmp/core*,但失败了.能告诉我如何解决这个问题.谢谢你的时间.
你可以使用这个access功能:
if (0 == access(path, 0)) {
file exists;
}
else {
file does not exist;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
36901 次 |
| 最近记录: |