ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | >> IO << | Directory | System | Time | Locale | CPUTime | Random

Module: IO
Function: hClose
Type: Handle -> IO ()
Description: hClose hdl makes handle hdl closed. Before the computation finishes, if hdl is writable its buffer is flushed as for hFlush. If the operation fails for any reason, any further operations on the handle will still fail as if hdl had been successfully closed.
Related:

Example 1
Program source: 

import IO

main = do hdl <- openFile "/tmp/foo.txt" WriteMode
	  hPutStr hdl "Hello, world!"
	  hClose hdl
	  hdl <- openFile "/tmp/foo.txt" ReadMode
	  x <- hGetContents hdl
	  putStr x
	  hClose hdl

Output: Hello, world!




_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet




Related sites:
  • dotNet Slackers - Your latest resource for ASP.NET
  • Dotnet Spider - Outsourcing and Offshore software development in India
  • XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
  • Planet Source Code - The largest public source code database on the Internet
conference call service VoIP Internettelefonie DSL, SDSL, ADSL answering service