try to workaround fopen64 issue

parent 796be468
Pipeline #183 passed with stage
in 54 seconds
Showing with 8 additions and 18 deletions
......@@ -222,7 +222,7 @@ FILE *FOpen(const char *f, const char *mode)
#if defined (WIN32) && !defined(__CYGWIN__)
setwbuf(0, f);
setwbuf(1, mode);
return _wfopen(wbuf[0], wbuf[1]);
return _wfopen64(wbuf[0], wbuf[1]);
#else
return fopen(f, mode);
#endif
......
......@@ -414,23 +414,13 @@ void Pos_Formulation(struct Formulation *Formulation_P,
}
}
else {
//Peter Binde: Writing NX binary unv files requires read AND write and fopen64
if(PostSubOperation_P->Format == FORMAT_NXUNV){
if((PostStream = fopen64(PostFileName, Flag_BIN ? "r+b" : "a")))
Message::Direct(4, " >> '%s'", PostFileName) ;
else{
Message::Error("Unable to open file '%s'", PostFileName) ;
PostStream = stdout ;
}
}
else{
if((PostStream = FOpen(PostFileName, Flag_BIN ? "ab" : "a")))
Message::Direct(4, " >> '%s'", PostFileName) ;
else{
Message::Error("Unable to open file '%s'", PostFileName) ;
PostStream = stdout ;
}
}
if((PostStream = FOpen(PostFileName,
Flag_BIN ? (FORMAT_NXUNV ? "r+b" : "ab") : "a")))
Message::Direct(4, " >> '%s'", PostFileName) ;
else{
Message::Error("Unable to open file '%s'", PostFileName) ;
PostStream = stdout ;
}
}
}
else{
......
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 sign in to comment