1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-06-08 10:26:36 +00:00

config option update_file now contains updated json of working instances after sync

This commit is contained in:
mithereal 2022-07-30 18:40:07 -07:00
parent a6e0c34abe
commit ca1e96470d
5 changed files with 22 additions and 9 deletions

View file

@ -92,4 +92,17 @@ defmodule Farside do
instance
end
end
def save_results(file, data) do
{:ok, file} = File.open(file, [:append])
bin = :erlang.term_to_binary(data)
IO.binwrite(file, bin)
File.close(file)
end
def restore_term(file) do
{:ok,bin} = File.read(file)
:erlang.binary_to_term(bin)
end
end