Commit ff2975a7 authored by Michael Smith's avatar Michael Smith

Workaround for cygwin bug where rename sometimes doesn't rename.

svn path=/trunk/vorbis-tools/; revision=2990
parent 538f9ffb
......@@ -484,6 +484,15 @@ void close_files(param_t *p)
if (p->out != NULL && p->out != stdout) fclose(p->out);
if (p->com != NULL && p->com != stdout && p->com != stdin) fclose(p->com);
rename(p->outfilename, p->infilename);
if(p->tempoutfile) {
/* Some platforms fail to rename a file if the new name already exists,
* so we need to remove, then rename. How stupid.
fprintf(stderr, "Error removing old file %s\n", p->infilename);
if(rename(p->outfilename, p->infilename))
fprintf(stderr, "Error renaming %s to %s\n", p->outfilename,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment