Find the answer to your Linux question:
Results 1 to 5 of 5
hi , everyone. i want to get the block numbers of a file. Could you tell me which function can i use? thanx!...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! bitzsk's Avatar
    Join Date
    Apr 2009
    Location
    Far, Far, Away on the earth
    Posts
    25

    How to get the block numbers of a file ?


    hi , everyone.

    i want to get the block numbers of a file. Could you tell me which function can i use?

    thanx!

  2. #2
    Linux User Krendoshazin's Avatar
    Join Date
    Feb 2005
    Location
    London, England
    Posts
    471
    I'm not entirely sure what you mean by block number, are you referring to the inode number?

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

    Exclamation

    block numbers are stored in file's inode. They represent the location where the files contents are stored.
    I would suggest downloading e2fsprogs and spending some time "debugfs" command will help you a lot -e2fsprogs has library that allows all activities with FS. If you want access blocks in "unprofessional messy way" you can check my tool giis source codes
    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

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined! bitzsk's Avatar
    Join Date
    Apr 2009
    Location
    Far, Far, Away on the earth
    Posts
    25
    Quote Originally Posted by Lakshmipathi View Post
    If you want access blocks in "unprofessional messy way" you can check my tool giis source codes
    thanks!

    what's mean by unprefessional messy way?

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

    Post

    giis code doesn't use standard libraries to access FS. Whereas almost all other tools use e2fsprogs library.
    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
  •