You could do it with a+ but why have the file open while transforming:
file = io.open("dump.txt", 'r')
modifyable = file:read()
file:close()
modified = doModifications(modifyable) -- (like changing all A to B)
file = io.open("dump.txt", 'a')
file:write(modified)
If you want to use a+:
file = io.open("dump.txt", 'a+')
modifyable = file:read()
modified = doModifications(modifyable) -- (like changing all A to B)
file:write(modified)