-- -- htnef, a program to do things to TNEF files. -- -- Copyright Michael Orlitzky -- -- http://michael.orlitzky.com/ -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- http://www.fsf.org/licensing/licenses/gpl.html import Data.Binary import System.Environment (getArgs) import Tnef.File -- Sequential IO -- Perform x, ignoring the result. -- Then return the result of doing the rest of the operations, -- which will be a single IO (). This forces evaluation -- of a list of IOs, i.e. [IO ()] sequential_io :: [IO ()] -> IO () sequential_io [] = return () sequential_io (x:xs) = do x sequential_io xs -- Decode whatever file is passed on the command line. main :: IO () main = do args <- getArgs tf :: TnefFile <- decodeFile (args !! 0) putStrLn (show tf) -- Dump the data... sequential_io (write_tnef_file tf) -- And write the attachments