Clear file contents in haskell language

独自空忆成欢 提交于 2019-12-25 06:45:17

问题


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?


回答1:


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

main = writeFile yourFile ""

But is this really what you want to do?



来源:https://stackoverflow.com/questions/20062595/clear-file-contents-in-haskell-language

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!