|
Halfs | Portability | GHC | Stability | alpha | Maintainer | Isaac Jones <ijones@galois.com> |
|
|
|
|
|
Description |
High-level interface to Halfs, the Haskell Filesystem.
|
|
Synopsis |
|
|
|
|
Write-related functions
|
|
|
Delete this file. Currently can be used to delete a directory,
but that should probably be FIXED.
|
|
|
Unlink this directory. Should only be called on empty
directories. Does not descent into sub-directories. Should fail
if given a file or if the directory is non-empty (but currently
doesn't: FIX).
|
|
|
:: FilePath | From
| -> FilePath | To
| -> FSWrite () | | Rename this file. Rename the file named as From to the file
named as To. Can throw an exception if From doesn't exist.
|
|
|
|
Create an empty directory at this path. Throws an error if
something already exists at this path.
|
|
|
:: Directory | to add to directory
| -> Inode | new child's inode
| -> String | Name of child to create inside directory.
| -> FSWrite Inode | | Like Direcotry.addChild, but in the FSWrite monad, and syncs this
directory.
|
|
|
|
Open the given file for writing. If a file exists at this
location, it gets overwritten. FIX: Test
|
|
|
Open the given file for appending. If a file already exists at
this location, it gets opened for writing, and the file pointer is
pointing to the end. FIX: Test, what does it do if no such file exists.
|
|
|
:: FileHandle | | -> Buffer | Buffer to write from
| -> INInt | Offset into above buffer FIX: should we allow current loc
| -> INInt | How many to write
| -> FSWrite INInt | | Write from the given buffer into the file.
|
|
|
|
Helpfer function for writing a string to a file.
|
|
|
Close a file that's open for writing.
|
|
|
Much like getDirectoryAtPath, builds a handle out of this
filepath. May throw IO Error! FIX: annotate w/ errors
thrown. FIX: throw errors for incorrect mode.
|
|
Read-related functions
|
|
|
Get basic information about the file at this path.
|
|
|
Get basic information about this file handle.
|
|
|
Open this file for reading. FIX: test.
|
|
|
|
|
|
Close a filehandle that's open for reading.
|
|
|
:: FileHandle | | -> INLong | What byte offset to move the filehandle to. Must be > 0 and < the number of bytes in the file.
| -> FSRead () | | Move this filehandle to given position.
|
|
|
|
|
Meta-data functions
|
|
|
|
|
Get the contents of a directory.
|
|
|
Does this filepath refer to a directory?
|
|
|
Caller may want to filter out . and ..
|
|
Creating new filesystems
|
|
|
:: DeviceLocation | | -> INInt | desired length of the new filesystem in blocks
| -> IO () | | Creates a new filesystem with a real-life root inode! Out of thin
air, create a buffer block for this device, 0, and write root inode
to our new cache.
|
|
|
|
:: | | => String | | -> INInt | | -> FSWrite a | Operations to perform
| -> IO a | | Create a new file system and perform the given operations. Unmounting
is up to the caller. See newFS for parameter details.
|
|
|
Mounting filesystems
|
|
|
|
|
|
Syncs the device and closes its handle. You should stop using it
after that. Must represent an open device!
|
|
|
Just like unmountFS but in the FSWrite monad.
|
|
|
|
|
|
:: | | => DeviceLocation | Location of device
| -> FSRead a | Operations to perform
| -> IO a | | Mount the given file system for reading and perform these
operations.
|
|
|
|
:: | | => DeviceLocation | Location of device
| -> FSWrite a | Operations to perform
| -> IO a | | Mount the given file system for writing and perform these
operations. FIX: Maybe add MVar () for blocking on.
|
|
|
Evaluating the FSRead and FSWrite moands
|
|
|
|
|
|
fsck
|
|
|
Check the filesystem for errors. Exits with an error code and
message if any are found. Outputs lots of low-level data to the
terminal.
|
|
|
See fsck.
|
|
|
:: MVar () | High-level blocker. This function blocks on this mvar.
| -> Bool | | -> FSWrite () | | Periodically sync the filesystem. Usually forked off in its own
thread. For READS: Flush caches on read-only filesystem (so
they'll be re-populated). For WRITES: write out the filesystem
data. FIX: remove readOnly; that's in the fsroot. FIX: add
exception handler (since it does a take)
|
|
|
|
|
Types (most are re-exported from elsewhere)
|
|
|
Instances | |
|
|
|
Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
|
|
|
|
Constructors | ReadMode | | WriteMode | | AppendMode | |
| Instances | |
|
|
|
|
|
The location of a device might be a path to the device on a Linux
filesystem.
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
Types to make abstract (FIX)
|
|
|
Read-write state
| Constructors | | Instances | |
|
|
|
This seems to be the kind of Stat information needed by the TSE
front end.
| Constructors | | Instances | |
|
|
|
Constructors | FileSystemStats | | blockSize :: Integer | Optimal transfer block size in bytes.
| blockCount :: Integer | Total data blocks in file system.
| blocksFree :: Integer | Free blocks in file system.
| blocksAvailable :: Integer | Free blocks available to non-superusers.
| fileCount :: Integer | Total file nodes in file system.
| filesFree :: Integer | Free file nodes in file system.
| maxNameLength :: Integer | Maximum length of filenames. FUSE default is 255.
|
|
|
|
|
|
Constructors | FsUnmounted | | FsReadOnly | | FsReadWrite | |
| Instances | |
|
|
testing
|
|
|
|
|
|
|
Produced by Haddock version 2.4.2 |