问题
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