问题
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