lua - Completely clearing a text file -


well, name self explanatory. don't know how go along , don't want risk breaking script deleting file , replacing it.

can post method use? tried searching around , far no luck.

posting egor skriptunoff's comment answer.

use

io.open(filename,"w"):close() 

where filename name of file want clear. open file writing , close file, discarding contents.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -