arclanguage / anarki

Community-managed fork of the Arc dialect of Lisp; for commit privileges submit a pull request.
http://arclanguage.github.io
Other
1.17k stars 161 forks source link

Write to a specific location in a file? #132

Open Kinnardian opened 5 years ago

Kinnardian commented 5 years ago

Arc has w/outfile and w/appendfile. Shouldn't there be a way to write to an arbitrary location in a file(insert?)? For example if I had a file that was a table of tables and I wanted to add a key/value to a specific table or edit the value of a certain key I'd have to read in the whole file and write out a whole new file with the change, no? That seems inefficient.

akkartik commented 5 years ago

That's just the nature of files on modern operating systems. They let you seek to a point in the file, but any writes there will over-write existing data. So you would have to write from that point to end of file, in practice.