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

Module: Directory
Function: renameFile
Type: FilePath -> FilePath -> IO ()
Description: renameFile old new changes the name of an existing file system object from old to new. If the new object already exists, it is atomically replaced by the old object. Neither path may refer to an existing directory. A conformant implementation need not support renaming files in all situations (for instance, renaming across different physical devices), but the constraints must be documented.
Related:

Example 1
Program source: 

import IO
import Directory

main = do hdl <- openFile "/tmp/foo.txt" WriteMode
	  hPutStr hdl "HELLO"
	  hClose hdl
	  a <- doesFileExist "/tmp/foo.txt"
	  renameFile "/tmp/foo.txt" "/tmp/bar.txt"
	  b <- doesFileExist "/tmp/foo.txt"
	  c <- doesFileExist "/tmp/bar.txt"
	  print (a,b,c)

Output: (True,False,True)




_____________________________________________
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
Alojamiento Web Domain Names conference call service answering service VoIP Internettelefonie
Hosted Exchange, SDSL VoIP Internettelefonie AT VoIP Internettelefonie DE