Now in the above example if we could have opened it for writing instead of appending, then the existing text would have been overwritten by the newly added text. This statement will open the file called aaa.txt for appending.Īs we already written the first line as “I love you”, this statement add the “addition of line “to the file.
This statement will open the file called aaa.txt for readingĪs we already written the first line as “I love you”, this statement will return that line.Īppending is very similar to writing except the fact that for appending the file need to be exist already and for writing if the file does not exist already autolisp will create it at its installation directory (most of the cases at “C:\Program Files\ACAD2000”) Reading and appending files: See the following example:
In continuation of part-2 of my article on same topic we will discuss some more autolisp functions and there use here.