Open limeytexan opened 5 years ago
Yeah that patch is not workable for portable code (don't recall mktemp
existing on windows; also if the tmp file is made in /tmp then rename won't work if /tmp is not on the same filesystem as the target), but the approach as a whole probably makes sense.
I recently observed that
relx
is unable to rewrite .app files with mode 0444, despite those files being in a directory with mode 0755. The error encountered was the following:The problem occurs within the
write_file_if_contents_differ()
function which attempts to replace the contents of the file in situ rather than writing to a new file and renaming the new version into place. The following patch solves the problem for me, although as I'm not an Erlang programmer I imagine there must be other/better solutions available:By way of context this patch is required for the use of
relx
on Nix where all files are mode 0444 by default.