Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

python truncate file contents

//one way is to open the file for writing
file = open("sample.txt","w")
file.close()

//another way
file = open("example.txt","r+")
file.truncate(0)
file.close()
Source by www.adamsmith.haus #
 
PREVIOUS NEXT
Tagged: #python #truncate #file #contents
ADD COMMENT
Topic
Name
8+4 =