我知道检查当前目录 opendir(dir_name)
,但我需要检查其他路径,而不是 CWD(current working directory)
,
或者是否有任何功能是在执行
时将CWD 移动到其他目录最佳答案
您可以使用 opendir(abs_path/dir_name)
打开绝对路径 abs_path
下的目录 dir_name
。
您也可以使用 chdir()
将您的 cwd 更改为其他目录。
关于c++ - 如何检查特定路径中不在 CWD 中的目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22472198/