Find the answer to your Linux question:
Results 1 to 6 of 6
Hi Sir, I am implementing a Stackable File System. I have to take inodes of all files/dir present in the dir in a structure. How would i do it ? ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2007
    Posts
    13

    How to get list of all inodes in a directory


    Hi Sir,
    I am implementing a Stackable File System.
    I have to take inodes of all files/dir present in the dir
    in a structure.
    How would i do it ?
    How to get list of inodes in a dir ?

  2. #2
    Linux User
    Join Date
    Dec 2007
    Location
    Idaho USA
    Posts
    362
    How to get list of inodes in a dir ?
    I would try debugfs /dev/hdxx 'where xx=hdd and partition' if you are using ext2/3 file system. Use the 'man' command to find out how to use debugfs. (man--debugfs , I think) or from within debugfs use ? for help.

    I'm not sure if it will give what you want or not.

    I am implementing a Stackable File System.
    I have to take inodes of all files/dir present in the dir
    in a structure.
    How would i do it ?
    Have no idea of what you are doing.

  3. #3
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Quote Originally Posted by PankajDS
    How to get list of inodes in a dir ?
    ls -i /directory/here

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Oct 2007
    Posts
    13
    Quote Originally Posted by anomie View Post
    ls -i /directory/here
    Yes.
    ] ls -i
    gives the list of name of dir/files and ther i-nodes.

    But I want to know, how to get it in program ?

  6. #5
    Just Joined!
    Join Date
    Feb 2008
    Posts
    50
    I think you need to use iget().. First see how the inode cache works.. so you can easily solve your problem..
    Thanks,
    Pankaj.

  7. #6
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,769

    Post

    I guess ,you need readdir() system call.
    Check
    Code:
    man readdir
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •