plugins-1.5.7: Dynamic linking for Haskell and C objects

Safe HaskellNone
LanguageHaskell98

System.Plugins.Utils

Synopsis

Documentation

hWrite :: Handle -> String -> IO () Source #

writeFile for Handles

mkUnique :: IO FilePath Source #

Get a new temp file, unique from those in /tmp, and from those modules already loaded. Very nice for merge/eval uses.

Will run for a long time if we can't create a temp file, luckily mkstemps gives us a pretty big search space

mkTemp :: IO (String, Handle) Source #

create a new temp file, returning name and handle. bit like the mktemp shell utility

replaceSuffix :: FilePath -> String -> FilePath Source #

return the object file, given the .conf file i.e. homedonsfoo.rc -> homedonsfoo.o

we depend on the suffix we are given having a lead .

mkModid :: String -> String Source #

work out the mod name from a filepath

changeFileExt Source #

Arguments

:: FilePath

The path information to modify.

-> String

The new extension (without a leading period). Specify an empty string to remove an existing extension from path.

-> FilePath

A string containing the modified path information.

Changes the extension of a file path.

joinFileExt :: String -> String -> FilePath Source #

The joinFileExt function is the opposite of splitFileExt. It joins a file name and an extension to form a complete file path.

The general rule is:

filename `joinFileExt` ext == path
  where
    (filename,ext) = splitFileExt path

splitFileExt :: FilePath -> (String, String) Source #

Split the path into file name and extension. If the file doesn't have extension, the function will return empty string. The extension doesn't include a leading period.

Examples:

splitFileExt "foo.ext" == ("foo", "ext")
splitFileExt "foo"     == ("foo", "")
splitFileExt "."       == (".",   "")
splitFileExt ".."      == ("..",  "")
splitFileExt "foo.bar."== ("foo.bar.", "")

isSublistOf :: Eq a => [a] -> [a] -> Bool Source #

dirname :: FilePath -> FilePath Source #

dirname : return the directory portion of a file path if null, return "."

basename :: FilePath -> FilePath Source #

basename : return the filename portion of a path

(</>) :: FilePath -> FilePath -> FilePath infixr 6 Source #

/, . : join two path components

(<.>) :: FilePath -> FilePath -> FilePath infixr 6 Source #

/, . : join two path components

(<+>) :: FilePath -> FilePath -> FilePath Source #

/, . : join two path components

(<>) :: FilePath -> FilePath -> FilePath Source #

/, . : join two path components

newer :: FilePath -> FilePath -> IO Bool Source #

is file1 newer than file2?

needs some fixing to work with 6.0.x series. (is this true?)

fileExist still seems to throw exceptions on some platforms: ia64 in particular.

invarient : we already assume the first file, a, exists

type EncodedString = String Source #

return the Z-Encoding of the string.

Stolen from GHC. Use -package ghc as soon as possible

panic :: String -> IO a Source #

useful