如果知道它是inode編號,如何獲取目錄名稱?需要代碼。謝謝。C編程:如果知道inode編號,如何獲取目錄名稱
下面的代碼通過dir_name ..
,然後我得到它的i節點號碼,但我也想要的是目錄名稱。
/*child stat*/
stat(dir_name, &sb);
if (stat(dir_name, &sb) == -1) {
perror("stat");
exit(EXIT_FAILURE);
}
childIno = (long) sb.st_ino;
的inode來的路徑是不是1:1的映射。 – Matt