how to get directory name by inode value in c?

╄→尐↘猪︶ㄣ 提交于 2019-12-20 02:05:35

问题


i am tring to add a new feature to bash and the job need a func to get the directory name from the given inode value so how to got this work? i mean if there's some builtin func in bash's source code if not , any help will be accept


回答1:


List the directory and get the inode of .. then list that and find the name of the file there that has the inode you are looking for.




回答2:


This is impossible without searching through the filesystem for a dir that contains a file with the given inode. Filenames are named references to inodes with no backlinks.



来源:https://stackoverflow.com/questions/4605851/how-to-get-directory-name-by-inode-value-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!