How to append some data to a file in Julia?

Viewed 1243

I have a text file and I want to append some string to it without writing over the existing data. How can I accomplish this in Julia?

1 Answers

Julia provides a bunch of different options to accomplish this same goal. One possible option is to do:

# Open file in append mode and then write to it
exampleFileIOStream =  open("example.txt","a")

write(exampleFileIOStream, "Hello world!");

You can read the full docs for the open function and the corresponding functionality in the Julia docs.

Related