par-cmdline compiles fine, in fact its more like great, with mingw32, but when I try to check or recover a parchive par says that the par file is corrupt. (something about a hash mismatch)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The original code looks correct and I believe is the better way to do it.
Has the fdopen bug in mingw32 been fixed? Perhaps upgrading the library
to fix the bug would be a better solution.
The reason I feel like the original is better is that it prevents creating
a unique file, then having another process create the same unique file
between the close() and fopen() calls. Of course, the scenario described
above would be VERY unlikely, so it's not that big of deal.
Regards,
Kerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
par-cmdline compiles fine, in fact its more like great, with mingw32, but when I try to check or recover a parchive par says that the par file is corrupt. (something about a hash mismatch)
in file fileops.c, line 188 (begining of function do_open), replace the line
if (i >= 0) f->f = fdopen(i, f->wr ? "w+b" : "rb");
with
if (i >= 0)
{
close(i);
f->f=fopen(f->name, f->wr ? "w+b" : "rb");
}
apparently there is a bug in function fdopen, only the beginning of the file was read.
The original code looks correct and I believe is the better way to do it.
Has the fdopen bug in mingw32 been fixed? Perhaps upgrading the library
to fix the bug would be a better solution.
The reason I feel like the original is better is that it prevents creating
a unique file, then having another process create the same unique file
between the close() and fopen() calls. Of course, the scenario described
above would be VERY unlikely, so it's not that big of deal.
Regards,
Kerry