Copyright | (C) 2014 Ricky Elrod |
---|---|
License | BSD2 (see LICENSE file) |
Maintainer | Ricky Elrod <ricky@elrod.me> |
Stability | experimental |
Portability | lens |
Safe Haskell | None |
Language | Haskell2010 |
This library exists for me to learn about ext2 and to possibly be used as part of an assignment in a Computer Science course I will be taking soon.
Please feel free to use it to learn about ext2 and play around, but don't use it for anything that you care about for now, because I don't trust myself.
- data Superblock = Superblock {
- sbInodesCount :: Word32
- sbBlocksCount :: Word32
- sbRBlocksCount :: Word32
- sbFreeBlocksCount :: Word32
- sbFreeInodesCount :: Word32
- sbFirstDataBlock :: Word32
- sbLogBlockSize :: Word32
- sbLogFragSize :: Word32
- sbBlocksPerGroup :: Word32
- sbFragsPerGroup :: Word32
- sbInodesPerGroup :: Word32
- sbMTime :: Word32
- sbWTime :: Word32
- sbMntCount :: Word16
- sbMaxMntCount :: Word16
- sbMagic :: Word16
- sbState :: Word16
- sbErrors :: Word16
- sbMinorRevLevel :: Word16
- sbLastCheck :: Word32
- sbCheckInterval :: Word32
- sbCreatorOs :: Word32
- sbRevLevel :: Word32
- sbDefResuid :: Word16
- sbDefResgid :: Word16
- sbFirstIno :: Word32
- sbInodeSize :: Word16
- sbBlockGroupNumber :: Word16
- sbFeatureCompat :: Word32
- sbFeatureIncompat :: Word32
- sbFeatureRoCompat :: Word32
- sbUuid :: ByteString
- sbVolumeName :: ByteString
- sbLastMounted :: ByteString
- sbAlgoBitmap :: Word32
- sbPreallocBlocks :: Word8
- sbPreallocDirBlocks :: Word8
- sbUnusedAlignment :: Word16
- sbJournalUuid :: ByteString
- sbJournalInum :: Word32
- sbJournalDev :: Word32
- sbJournalLastOrphan :: Word32
- sbHashSeed :: (Word32, Word32, Word32, Word32)
- sbDefHashVersion :: Word8
- sbDefaultMountOptions :: Word32
- sbFirstMetaBg :: Word32
- readSuperblock :: MonadGet m => m Superblock
- data BlockGroupDescriptorTable = BlockGroupDescriptorTable {}
- readBlockGroupDescriptorTable :: MonadGet m => m BlockGroupDescriptorTable
- data Inode = Inode {
- iMode :: Word16
- iUid :: Word16
- iSize :: Word32
- iAtime :: Word32
- iCtime :: Word32
- iMtime :: Word32
- iDtime :: Word32
- iGid :: Word16
- iLinksCount :: Word16
- iBlocks :: Word32
- iFlags :: Word32
- iOsd1 :: Word32
- iBlock :: (Word32, Word32, Word32, Word32, Word32, Word32, Word32, Word32, Word32, Word32, Word32, Word32, Word32, Word32, Word32)
- iGeneration :: Word32
- iFileAcl :: Word32
- iDirAcl :: Word32
- iFaddr :: Word32
- iOsd2 :: ByteString
- readInode :: MonadGet m => m Inode
- readInodeTable :: MonadGet m => Int -> m (Vector Inode)
- data Directory = Directory {}
- readDirectory :: MonadGet m => m Directory
Superblock
data Superblock
Superblock | |
|
Parsers
readSuperblock :: MonadGet m => m Superblock
Reads the superblock information from an ext2 filesystem. Does not skip the first 1024 bytes to where the superblock lives.
See also readExtendedSuperblock
BlockGroupDescriptorTable
Parsers
readBlockGroupDescriptorTable :: MonadGet m => m BlockGroupDescriptorTable
Reads the block group descriptor table. The last 12 ("reserved") bytes are ignored and skipped over (consumed).
Inode
data Inode
Inode | |
|
Parsers
readInodeTable :: MonadGet m => Int -> m (Vector Inode)
Directory
Parsers
readDirectory :: MonadGet m => m Directory