On 12/01/2010 05:49 AM, Slavko Kocjancic wrote:
> Hello...
>
> I was trying to change behaviour of (LOGOPEN, filename) feature to not
> truncate file when oppened (to add)
> As my knowledge with C is not good I can't manage to do in way I like
> and to be good for others too.
> My idea was to use (LOGOPEN, filename) as is and (LOGOPEN, filename,
> append) to append to file.
> But I can't find a way to do it. So After little twigeling I manage like
> this:
>
> (LOGOPEN, filename) as is
> (LOGOPEN, _filename) to append to the file. (filename start's with
> underscore)
>
> and change was done in src/emc/task/emccanon.cc
>
> the old way is:
>
> void LOGOPEN(char *name) {
> if(logfile) fclose(logfile);
> logfile = fopen(name, "wt");
> fprintf(stderr, "LOGOPEN(%s) -> %p\n", name, logfile);
> }
>
>
> changed to:
>
> void LOGOPEN(char *name) {
> if(logfile) fclose(logfile);
> if (name[1] == '_') {
>
s/b if (name[0] == '_') { // arrays in C begin with the 0 element
> logfile = fopen(name, "at");
>
S/B logfile = fopen(name+1, "at"); // you want to skip the '_'
> } else {
> logfile = fopen(name, "wt");
> }
> fprintf(stderr, "LOGOPEN(%s) -> %p\n", name, logfile);
> }
>
>
> It's works. But can someone check if maybe I make something dumb, and to
> update that in 2.5.0~pre? (probably comment in manual is good to have too)
>
> Thanks
> Slavko.
>
> p.s.
> What is 'correct' way to post such changes?!
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500!
> Tap into the largest installed PC base& get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers