Previous Next Home
hGetLine takes a Handle and reads a line form file (or) given handle. You may get isEOFError, when handle reaches to end of file.
Prelude System.IO> :t hGetLine
hGetLine :: Handle -> IO String
Suppose ‘today.txt’ contains following data.
Following program takes a file name as input and print the information of file line by line.