Examples-0.1.0: Haskell code examples
Copyright© Frank Jung 2024
LicenseGPL-3.0-only
Safe HaskellSafe-Inferred
LanguageHaskell2010

ShowFile

Description

 
Synopsis

Types

data FileInfo Source #

Constructors

FileInfo 

Instances

Instances details
Show FileInfo Source # 
Instance details

Defined in ShowFile

Functions

noPasswd :: FilePath -> IO String Source #

Show path except if `etcpasswd`. Better as an Either, filename or "invalid file error".

showContent :: FilePath -> IO String Source #

Show file content.

makeAndReadFile :: Int -> IO String Source #

Make and read a file. Write and then read a file.

makeAndShow :: Int -> IO () Source #

Make and show file helper function. Write and read a file.

safeIO :: Int -> IO () Source #

Test writing and reading a number of files. Efficient sequencing of IO actions ensuring file handle is closed.

getFileInfo :: FilePath -> IO FileInfo Source #

Get file info.

showTime :: UTCTime -> String Source #

Helper function to convert UTCTime to ISO date string.

parseTime :: String -> Maybe UTCTime Source #

Helper function to convert ISO date string to UTCTime.

ISO date/time format string is "%Y-%m-%dT%T%Z"

Example: "2023-11-22T04:27:27Z"