jakearchibald / byte-storage

41 stars 2 forks source link

rename store #5

Open inexorabletash opened 7 years ago

inexorabletash commented 7 years ago

A common approach to atomically updating files is to write into a "temp" copy, then rename the temp into place over top of the original.

(copy may be a primitive we want as well)

jakearchibald commented 7 years ago

Makes sense.

I wonder if .copy() would offer any perf benefit. We might be able to be smart about streams and get the same benefit. .copy() might still be nice for convenience.