当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


haskell getModificationTime用法及代码示例


Haskell语言Directory模块中函数getModificationTime的用法及代码示例。

用法类型:

FilePath -> IO ClockTime

返回上次修改文件/目录的时钟时间

示例1:

源码:

import IO
import Directory

main = do x <- getModificationTime "/tmp/foo.txt"
	  print x
          hdl <- openFile "/tmp/foo.txt" AppendMode
	  hPutStr hdl "Hello"
	  hClose hdl
	  y <- getModificationTime "/tmp/foo.txt"
	  print y

输出:
Tue Apr 16 08:34:03 GMT 2002
         
输出:
Tue Apr 16 08:37:17 GMT 2002
         

注:本文由纯净天空筛选整理自 haskell getModificationTime。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。