以haskell语言清除文件内容 [英] Clear file contents in haskell language
本文介绍了以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屋!
查看全文