Delete all the content from file

Viewed 24310

I want to remove the content form the list of files.

EDIT :

I have list of files.

file1 file2 file3

Those file containing bunch of lines ...

I want to remove all the lines from each files.

3 Answers

Since truncate is not available on all platforms, use f = open('filename', File::TRUNC) {}

Related