don't truncate the file when reading rels
write data to a temp file first to get atomic writes