Bill Allombert on Sun, 26 Oct 2014 21:20:48 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: How cancel old content in write


On Sun, Oct 26, 2014 at 09:08:24PM +0100, Josef Eschgfaeller wrote:
> Is there a function for writing to
> a file, erasing the old content?

There is none, mostly for historical reason.

> --------------------------------------------------
> writetofile (file,text) =\
> {system(Strprintf("rm -f %s",file));
> write(file,text)}
> --------------------------------------------------

Yes, this is a solution.

Cheers,
Bill.