1

I need to know how to exactly computed record rec_len. How it is count ?

enter image description here

jww
  • 97,681
  • 90
  • 411
  • 885
loczek
  • 123
  • 1
  • 6
  • It looks like all records are a multiple of 4 bytes, and unused bytes are padded with 0. That's why the `.` is `name_len=1` and padded with `\0\0\0`; and why the `..` is `name_len=2` and padded with `\0\0`. You should probably just lookup [the ext2 spec](https://duckduckgo.com/?q=ext2+filesystem+spec). There are probably other cases to consider that may need special handling. – jww Jun 21 '19 at 18:10

1 Answers1

0

the inode is 4bytes + 1byte of the file_type + 1byte of the name_len + 2bytes of the rec_len + name data which is 1byte per character and the record must be padded to x4 ( 4 bytes boundaries ) that's why we add the "\0" for padding


for the first example . you have 4+1+1+2+4=12 and the same for others

zerocool
  • 3,256
  • 2
  • 24
  • 40