Re: [Plib-devel] Re: [Plib-cvs] plib/src/ssg ssgLoadAC.cxx,1.36,1.37
Brought to you by:
sjbaker
From: Frederic B. <fre...@fr...> - 2005-12-07 13:53:53
|
Quoting steve : > Bram Stolk wrote: > > steve wrote: > > > >>Bram Stolk wrote: > >> > >> > >>>Update of /cvsroot/plib/plib/src/ssg > >>>In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8823 > >>> > >>>Modified Files: > >>> ssgLoadAC.cxx Log Message: > >>>Avoid append flag. Fix by Mathias > >> > >> > >>- loader_fd =3D fopen ( filename, "ra" ) ; > >>+ loader_fd =3D fopen ( filename, "r" ) ; > >> > >> > >>Wooaaahhhhhh. > >> > >>That's not right! > >> > >>The 'a' flag only means 'append' if it's the first character > >>in the mode string. In the second position, it should be > >>ignored. On some systems, an 'a' in the second position > >>means "ASCII" (as opposed to 'b' for binary). > >> > >>I'm sceptical about this patch. > > > > > > Well... I'll be happy to reverse it, but I tried to find > > information about this "ra" mode. > > Well, exactly - not many OS's use it. What I'm sceptical > about is how (if at all) it fixes anything. Mainly though, > the commit comment "Avoid append flag" shows a misunderstanding > of what "ra" means. It DOES NOT MEAN 'Append'. That would be > "a" by itself. Visual C++ 2005 Express generate an exception when meeting the "a" at the= second position, as it consider it as an invalid option. Reading the fopen man page from Tru64 Unix, it is stated that "+" should = be used for updating. So the right way to open an ascii file in update mode is "r+" not "ra". > > So if this patch was intended to fix something - then the > person doing the fixing didn't understand what they were > doing - and we should be sceptical about whether this is > indeed the correct patch. -Fred |