how to get directory name by inode value in c?

后端 未结 2 1183
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 06:09

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 fu

相关标签:
2条回答
  • 2021-01-21 06:34

    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.

    0 讨论(0)
  • 2021-01-21 06:54

    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.

    0 讨论(0)
提交回复
热议问题