appending logfile

John Esak john at valar.com
Thu Feb 26 16:03:48 PST 2009


Scott,
I'm writing from my PDA so this could be a little strange...

Anyway, sounds like you are using LOGTEXT or something... My suggestion is
to just open a file with open() and writeline() to it yourself until your
done.  Then, remember to close() it.  Be sure that the open() does not have
the "truncate" flag and the next time any process opens the file it will see
there what used to be there unless something else affects or it or the open
you use has the truncate flag....

Then: declare h_o(8,.0), h_wl(5,.0), h_c(8,.0)
  if: h_o lt "0"
Then: errorbox "Pen failed.";  return  or go somewhere else...
Then: h_o=open("/path/to/mylogfile.txt","rwct")   no truncate on open
Then: h_w=writeline(h_o,aa)
....
Then: h_w=writeline(h_o,aa)
...

When done:

Then: h_c=close(h_o)


aa is the variable holding the line you want to post....

h_o=open("/path/to/mylogfile.txt","rwct0")   Truncates when opening

The variables h_o, h_wl, H_c... Could actually all essentially be any
variable. They are the handle which the other file I/O functions use to read
and write to "opened" files.  You can test them for errors that were
returned... Learn how many characters were read or written by a command...
Among toher things.  The functions are all pretty simple, and work like C
almost to a T.

Don't know if you use the file I/O stuff or not, so I don't know how much to
put here. If you don't, they will enhance your filePro abilities
tremendously.  I can see that the built-in LOGTEXT command is simple enough,
but it is obviously very limited, not only in the way you think it may be
but lots of other ways.  The readline/writeline functions allow you very
complete "text" functionality.  If you want to read and write chunks of data
without automaticlly adding a newline like writeline() or stop at the first
encounterd newline like readline() does, then you would want read() and
write() both of which can go up to 32,768 characters. (or is it 32,767??? I
never really tested this... I think it is 1 relative so 32,768 probably.)

Anyway, this might not be the response you wanted... Good luck.

John

 

> -----Original Message-----
> From: filepro-list-bounces+john=valar.com at lists.celestial.com 
> [mailto:filepro-list-bounces+john=valar.com at lists.celestial.co
m] On Behalf Of Scott Nelson
> Sent: Thursday, February 26, 2009 6:34 PM
> To: filePro Mailing List
> Subject: appending logfile
> 
> When setting a logfile in a processing table, each time the program 
> runs, the logfile is cleared and filled only from that 
> process.  I can 
> not seem to find a setting to append to an existing logfile, 
> unless it 
> is the default one.
> 
> Can this be done?
> 
> Scott
> 
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
> 



More information about the Filepro-list mailing list