Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to append a line of text to a existing file in ionic 2?

Tags:

file

ionic2

I thought it was a silly question, but...

I'd tried try writeExistingFile(path, fileName, text) but it replace the file.

I'd tried writeFile(path, fileName, text, true), the same

I'd tried writeFile(path, fileName, text, false) and I got PATH_EXIST_ERROR

I can read the file, append the newline, write the file... but it seems a little crazy! Someone help?

P.

like image 681
Pietro Molina Avatar asked Mar 10 '23 09:03

Pietro Molina


1 Answers

Try: writeFile(path, fileName, text, {append: true, replace: false})

like image 53
chris g Avatar answered Mar 23 '23 12:03

chris g