Hallo,
i´m quiet new with learning c.
i have to print the block bitmap (data bitmap) from a blockgroup.
i don´t know how to begin. could you please so kind and help me?
thanks
Hallo,
i´m quiet new with learning c.
i have to print the block bitmap (data bitmap) from a blockgroup.
i don´t know how to begin. could you please so kind and help me?
thanks
If you just want to know blockgroup info, look into the dumpe2fs utility, it might give you what you want.
If you're new to C, I recommend starting here: C, C++ Programming Tutorials - Cprogramming.com. Messing directly with the file system is probably not a good idea until you have a solid grasp of C.
As for the ext2 specifics, I can't help you much as I've never delved into the inner workings. The code for all the ext2 utilities is open source, so perhaps you could look at the source of dumpe2fs, tune2fs and debugfs to get an idea of the inner workings. There's probably a library somewhere that gives you a nice API for messing with ext2 file systems.
This seemed pretty easy to find.
Internals of the ext2 Filesystem
> i´m quiet new with learning c.
But newbies messing around with code running as "root" and accessing the low level file system is a recipe for disaster.
Do you really have to read your own block, or are you perhaps just given a file containing just "the bits" and you have to decode it "as if" you had just read the block yourself. This option is FAR FAR safer for you to tackle.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
And most likely isn't a good idea, even then...Originally Posted by Andurl462
I have to enter each blockgroup and then print every datablock bitmap.
OK, so show some code to let us see where you're heading with this, and what your general skill level is like.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.