1. Simple Euphoria Suggestion

Why could'nt Euphoria have a magic builtin function that
would take a parameter which would be the name of a file.

Then the user could create or open a file and use it for
cleanup, error dumps, crash information, etc... Whatever
the user wants to use it for.

Then when a user writes a program, the user at the beginning
of his program calls the magic built-in function to tell Euphoria
the name of his file or its file number.

All the Euphoria code has to do is save the name of the
file and when Euphoria shuts down or terminates,
it simply closes this file. 

This would be very easy to implement.
It could be used even when program don't crash.
It would have more uses than a crash message.

Bernie

new topic     » topic index » view message » categorize

2. Simple Euphoria Suggestion

I am reposting this because of the topica posting being messed up
a couple of days ago, I thought I would see some reply or disscusion.

Why could'nt Euphoria have a magic builtin function that
would take a parameter which would be the name of a file.

Then the user could create or open a file and use it for
cleanup, error dumps, crash information, etc... Whatever
the user wants to use it for.

Then when a user writes a program, the user at the beginning
of his program calls the magic built-in function to tell Euphoria
the name of his file or its file number.

All the Euphoria code has to do is save the name of the
file and when Euphoria shuts down or terminates,
it simply closes this file. 

This would be very easy to implement.
It could be used even when program don't crash.
It would have more uses than a crash message.

Bernie

new topic     » goto parent     » topic index » view message » categorize

3. Re: Simple Euphoria Suggestion

>From: Bernie Ryan <xotron at bluefrognet.net>
>Subject: Simple Euphoria Suggestion
>
>
>I am reposting this because of the topica posting being messed up
>a couple of days ago, I thought I would see some reply or disscusion.
>
>Why could'nt Euphoria have a magic builtin function that
>would take a parameter which would be the name of a file.
>
>Then the user could create or open a file and use it for
>cleanup, error dumps, crash information, etc... Whatever
>the user wants to use it for.
>
>Then when a user writes a program, the user at the beginning
>of his program calls the magic built-in function to tell Euphoria
>the name of his file or its file number.
>
>All the Euphoria code has to do is save the name of the
>file and when Euphoria shuts down or terminates,
>it simply closes this file.
>

   It always closes the open files. In fact, Windows automatically closes 
any open file in a program when the program exits. Perhaps, you want 
Euphoria to flush the file, too. It might do this already, too; I'm not 
sure.

>This would be very easy to implement.
>It could be used even when program don't crash.
>It would have more uses than a crash message.
>
>Bernie
>
>
>
>
>TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: Simple Euphoria Suggestion

Bernie Ryan wrote:
> Why could'nt Euphoria have a magic builtin function that
> would take a parameter which would be the name of a file.
> 
> Then the user could create or open a file and use it for
> cleanup, error dumps, crash information, etc... Whatever
> the user wants to use it for.
> 
> Then when a user writes a program, the user at the beginning
> of his program calls the magic built-in function to tell Euphoria
> the name of his file or its file number.
> 
> All the Euphoria code has to do is save the name of the
> file and when Euphoria shuts down or terminates,
> it simply closes this file. 
> 
> This would be very easy to implement.
> It could be used even when program don't crash.
> It would have more uses than a crash message.

I don't understand what you are saying here.
Isn't it easy enough to open a debug file and
write whatever you like into it? If your program
dies prematurely, Euphoria will close the file for you
and write out any buffered data. Also, there's already
a way to change "ex.err" to the path of another
file in another directory (see crash_file()).

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

5. Re: Simple Euphoria Suggestion

>I don't understand what you are saying here.
>Isn't it easy enough to open a debug file and
>write whatever you like into it? If your program
>dies prematurely, Euphoria will close the file for you
>and write out any buffered data. Also, there's already
>a way to change "ex.err" to the path of another
>file in another directory (see crash_file()).

If I open a file and I am writing to it and do not close it
and the program ends. Euphoria closes it and it is an empty file.

There is no method to insert my data into the ex.err file or append
data to the Euphoria ex.err data.

My understanding of crash_file is to just to allow me to name the ex.err
file to something else but not to intermix my data with the ex.err data .
Also crash_file can only be used if the program crashs.


Bernie

new topic     » goto parent     » topic index » view message » categorize

6. Re: Simple Euphoria Suggestion

It was not writing out buffered data at the time I created elog.e
Each call to my routine would:
open the log file
write a line to it.
close the log file

        Lucius L. Hilley III

----- Original Message ----- 
From: "Robert Craig" <rds at RapidEuphoria.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Simple Euphoria Suggestion


> 
> 
> Bernie Ryan wrote:
> > Why could'nt Euphoria have a magic builtin function that
> > would take a parameter which would be the name of a file.
> > 
> > Then the user could create or open a file and use it for
> > cleanup, error dumps, crash information, etc... Whatever
> > the user wants to use it for.
> > 
> > Then when a user writes a program, the user at the beginning
> > of his program calls the magic built-in function to tell Euphoria
> > the name of his file or its file number.
> > 
> > All the Euphoria code has to do is save the name of the
> > file and when Euphoria shuts down or terminates,
> > it simply closes this file. 
> > 
> > This would be very easy to implement.
> > It could be used even when program don't crash.
> > It would have more uses than a crash message.
> 
> I don't understand what you are saying here.
> Isn't it easy enough to open a debug file and
> write whatever you like into it? If your program
> dies prematurely, Euphoria will close the file for you
> and write out any buffered data. Also, there's already
> a way to change "ex.err" to the path of another
> file in another directory (see crash_file()).
> 
> Regards,
>     Rob Craig
>     Rapid Deployment Software
>     http://www.RapidEuphoria.com
> 
> --^----------------------------------------------------------------
> This email was sent to: l3euphoria at bellsouth.net
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
>

new topic     » goto parent     » topic index » view message » categorize

7. Re: Simple Euphoria Suggestion

In short, elog.e already exists.  I created it a long time ago. I don't
think
it ever made it to the archives. But, I'm not the first or last to create
such
a system.

PROBLEMS:
1. Logging everything to file will make a large file or you can limit it to
    the last 1000 lines or something.
2. Logging everything will dramatically slow down the program with
    lots of disk activity.

Have you  looked elog.e   When running and tracking every move.
There is way too much disk activity. But if you limit the places you use the
logging. The activity drops dramatically.  You limit the logging to the
areas
of suspected problem. You can switch it in and out of logging mode.
That means you could provide a debug switch for when you want to log
what is going on.  The log won't tell you want happened. But it can tell
you where it happened.  Exactly where.  You can tell how deep you are
into the routine.

        Lucius L. Hilley III

----- Original Message ----- 
From: "Bernie Ryan" <xotron at bluefrognet.net>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, September 24, 2003 11:19 AM
Subject: Simple Euphoria Suggestion


>
>
> I am reposting this because of the topica posting being messed up
> a couple of days ago, I thought I would see some reply or disscusion.
>
> Why could'nt Euphoria have a magic builtin function that
> would take a parameter which would be the name of a file.
>
> Then the user could create or open a file and use it for
> cleanup, error dumps, crash information, etc... Whatever
> the user wants to use it for.
>
> Then when a user writes a program, the user at the beginning
> of his program calls the magic built-in function to tell Euphoria
> the name of his file or its file number.
>
> All the Euphoria code has to do is save the name of the
> file and when Euphoria shuts down or terminates,
> it simply closes this file.
>
> This would be very easy to implement.
> It could be used even when program don't crash.
> It would have more uses than a crash message.
>
> Bernie
>
>
> --^----------------------------------------------------------------
> This email was sent to: l3euphoria at bellsouth.net
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

8. Re: Simple Euphoria Suggestion

On Thu, 25 Sep 2003 10:30:25 -0400, Bernie Ryan
<xotron at bluefrognet.net> wrote:

>If I open a file and I am writing to it and do not close it
>and the program ends. Euphoria closes it and it is an empty file.

integer fn
fn=3Dopen("temp.log","w")
	puts(fn,"run this just once")
?9/0

Works for me on ex and exw, 2.3 and 2.4, the file is not empty.

Pete

new topic     » goto parent     » topic index » view message » categorize

9. Re: Simple Euphoria Suggestion

Bernie Ryan wrote:
> If I open a file and I am writing to it and do not close it
> and the program ends. Euphoria closes it and it is an empty file.

Try this:


integer debug_file
debug_file = open("debug.out", "w")

for i = 1 to 10 do
     printf(debug_file, "%d. Euphoria\n", i)
end for

-- No close()!!!  - Doesn't matter


If you really wrote something into the file,
you would see it, unless there was a severe crash
that could not be handled by the interpreter
for some reason - maybe your program or a .dll
did something really nasty.

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

10. Re: Simple Euphoria Suggestion

Lucius Hilley wrote:
> It was not writing out buffered data at the time I created elog.e
> Each call to my routine would:
> open the log file
> write a line to it.
> close the log file

You probably needed that in the case of machine-level exceptions.
Prior to 2.4, if your program poked into a bad place in memory,
or otherwise caused a machine-level exception, the interpreter
would not recover, so you wouldn't get an ex.err, and your files
wouldn't be flushed.

With a normal Euphoria error (e.g. subscript
out of bounds) files have always been flushed. The main reason
for closing files, other than being neat and tidy, is that
each open file uses a bit of memory, and all operating systems
place a limit on the number of simultaneously open files.

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

11. Re: Simple Euphoria Suggestion

Rob:
   Thanks, It must be the way my program was crashing.
   It seems that if you can react to a exception error you
   should still be able to close any open files.
Bernie

PS: Thanks to everyone else who responded

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu