Copyright | (C) 2015 Ricky Elrod |
---|---|
License | BSD2 (see LICENSE file) |
Maintainer | Ricky Elrod <ricky@elrod.me> |
Stability | experimental |
Portability | lens |
Safe Haskell | None |
Language | Haskell2010 |
This module exports utility functions for working with ext2 after it has been parsed into Haskell types.
- blockGroupCount :: Superblock -> Int
- byteFromBlock :: Superblock -> Int -> Int
- getSuperblock :: String -> IO Superblock
- getBGDT :: String -> IO BlockGroupDescriptorTable
- getAllTables :: ByteString -> (Superblock, BlockGroupDescriptorTable, Vector Inode)
- listRootFiles :: String -> IO [ByteString]
Utility functions
blockGroupCount :: Superblock -> Int
Get the number of block groups within the file system.
byteFromBlock :: Superblock -> Int -> Int
Given a Superblock
, and the block number, get the byte number at which
it starts.
Silly test/helper functions
getSuperblock :: String -> IO Superblock
Open an ext2 filesystem and parse out the Superblock
.
getBGDT :: String -> IO BlockGroupDescriptorTable
Open an ext2 filesystem and parse out the BlockGroupDescriptorTable
.
getAllTables :: ByteString -> (Superblock, BlockGroupDescriptorTable, Vector Inode)
Parses all tables out.
listRootFiles :: String -> IO [ByteString]
Lists names of all files in the root directory.