以haskell语言清除文件内容 [英] Clear file contents in haskell language

查看:102
本文介绍了以haskell语言清除文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何清除haskell中的所有文件内容?任何人都可以帮助解决这个问题,我想从文本文件中删除所有的数据并将其清空。是否有任何函数可以这样做?

或者我可以做任何这样的函数吗?

解决方案

  main = writeFile yourFile

但这真的是你想要做的吗?


How to clear all the file contents in haskell.?Can anyone help this,I want to remove all the data from a text file and make it empty.Is their any function to do so?

Or can i make any such function?

解决方案

You can write nothing on the file, overwriting what was there before.

main = writeFile yourFile ""

But is this really what you want to do?

这篇关于以haskell语言清除文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆