Monitoring events in my program and emailing reports

P

Pie

I like to have my program (running on my home machine)
email me (wherever I am) whenever it reaches a certain mile-stone
(finishes a phase of the simulation or runs into an interesting
path in the simulation). I just like add the feature so it can
email me the partial results. Is there a source code for
something like this I can add to my program? Do I need
an SMTP server code or can I use my current SMTP ISP smtp
server to email myself?

I know I can always write the results in d file on my web
server, but I want results emailed to myself when needed.

Thanks a lot in advance.

Ben
 
K

Kevin Goodsell

Pie said:
I like to have my program (running on my home machine)
email me (wherever I am) whenever it reaches a certain mile-stone
(finishes a phase of the simulation or runs into an interesting
path in the simulation). I just like add the feature so it can
email me the partial results. Is there a source code for
something like this I can add to my program? Do I need
an SMTP server code or can I use my current SMTP ISP smtp
server to email myself?

I know I can always write the results in d file on my web
server, but I want results emailed to myself when needed.

Thanks a lot in advance.

Ben

There may be sources available, but 1) this is not comp.sources.wanted
and 2) those sources won't be in standard C++ (the topic here), since
standard C++ has no support for email, or networking of any kind.

-Kevin
 
J

Jeff Schwab

Kevin said:
There may be sources available, but 1) this is not comp.sources.wanted
and 2) those sources won't be in standard C++ (the topic here), since
standard C++ has no support for email, or networking of any kind.

True that.

If you have a command-line program to mail stuff on your platform
already, you could use system( "mail myfile.txt" ) or open a pipe to the
program.
 
K

Kevin Goodsell

Jeff said:
If you have a command-line program to mail stuff on your platform
already, you could use system( "mail myfile.txt" ) or open a pipe to the
program.

But you can't open a pipe using standard C++.

-Kevin
 
J

Jeff Schwab

Kevin said:
But you can't open a pipe using standard C++.

Yes, you can. You just have to make a platform-specific system call.
The system may or may not provide such functionality, just as it may or
may not provide a mail program with a CLI. There is nothing in the
standard that says you can't open a pipe.
 
K

Kevin Goodsell

Jeff said:
Yes, you can. You just have to make a platform-specific system call.

How is a a platform-specific system call standard C++?
The system may or may not provide such functionality, just as it may or
may not provide a mail program with a CLI. There is nothing in the
standard that says you can't open a pipe.

There's nothing that says you can't travel through time, either. Maybe I
should get to work on that standard C++ time travel program.

-Kevin
 
J

Jeff Schwab

Kevin said:
How is a a platform-specific system call standard C++?

What part of it violates the standard? Calling a function that's not
part of the standard library doesn't make a program non-standard. Don't
you use functions you wrote yourself, or functions someone else wrote
for you? System calls are the latter.
There's nothing that says you can't travel through time, either. Maybe I
should get to work on that standard C++ time travel program.

LOL. Yes, I think you should. :)
 
C

Claudio Puviani

Kevin Goodsell said:
How is a a platform-specific system call standard C++?

I think the problem here -- and it's a recurring one -- is in the phrasing of
that assertion. It's misleading toward beginners to state that "you can't do
[networking|graphics|etc.] in Standard C++" and it's pejorative to C++ to imply
such an inability. The standard has never precluded using third party libraries
and a program that does use third party libraries doesn't suddenly become
non-conforming. If instead, it were phrased as "that functionality is not
included in the core language or the standard libraries and discussions of
third party or platform-specific libraries is off-topic in this newsgroup", it
would not mislead anyone into thinking it a limitation of C++, which it clearly
isn't.

Claudio Puviani
 
K

Kevin Goodsell

Jeff said:
What part of it violates the standard? Calling a function that's not
part of the standard library doesn't make a program non-standard. Don't
you use functions you wrote yourself, or functions someone else wrote
for you? System calls are the latter.

I'm not saying it violates the standard, I'm saying it's /not/ standard.
In other words, it's not defined by the standard. A program that "opens
a pipe" is using non-standard functionality, and can no longer be
considered a standard C++ program.

-Kevin
 
J

Jeff Schwab

Kevin said:
I'm not saying it violates the standard, I'm saying it's /not/ standard.
In other words, it's not defined by the standard. A program that "opens
a pipe" is using non-standard functionality, and can no longer be
considered a standard C++ program.

Are you saying a pipe can't be implemented in C++?
 
K

Kevin Goodsell

Jeff said:
Are you saying a pipe can't be implemented in C++?

I'm not 100% sure that I know exactly what you mean by "pipe", but the
C++ standard does not provide any means of communication between
processes, so I don't believe you can implement it in standard C++ (that
is, using the functionality provided by the C++ standard).

-Kevin
 
J

Jeff Schwab

Kevin said:
I'm not 100% sure that I know exactly what you mean by "pipe", but the
C++ standard does not provide any means of communication between
processes, so I don't believe you can implement it in standard C++ (that
is, using the functionality provided by the C++ standard).

There is no direct provision for pipes in the standard, just as there is
no direct support for GUI's. However, both can be implemented in C++.
If you just mean that pipes aren't mentioned in the C++ standard, then I
agree with you wholeheartedly. I don't think acknowledging that we do
have operating systems, and that these systems sometimes support pipes,
is off-topic in comp.lang.c++ though. If you want to stick to a strict
discussion of the ISO standard, check out comp.std.c++. I lurk there
myself.
 
R

red floyd

Claudio said:
Kevin Goodsell said:
Jeff Schwab wrote:
[no you can't - yes I can redacted]
I think the problem here -- and it's a recurring one -- is in the phrasing of
that assertion. It's misleading toward beginners to state that "you can't do
[networking|graphics|etc.] in Standard C++" and it's pejorative to C++ to imply
such an inability. The standard has never precluded using third party libraries
and a program that does use third party libraries doesn't suddenly become
non-conforming. If instead, it were phrased as "that functionality is not
included in the core language or the standard libraries and discussions of
third party or platform-specific libraries is off-topic in this newsgroup", it
would not mislead anyone into thinking it a limitation of C++, which it clearly
isn't.

Nicely phrased Claudio! I like it!
 
J

Jeff Schwab

red said:
[no you can't - yes I can redacted]
I think the problem here -- and it's a recurring one -- is in the
phrasing of
that assertion. It's misleading toward beginners to state that "you
can't do
[networking|graphics|etc.] in Standard C++" and it's pejorative to C++
to imply
such an inability. The standard has never precluded using third party
libraries
and a program that does use third party libraries doesn't suddenly become
non-conforming. If instead, it were phrased as "that functionality is not
included in the core language or the standard libraries and
discussions of
third party or platform-specific libraries is off-topic in this
newsgroup", it
would not mislead anyone into thinking it a limitation of C++, which
it clearly
isn't.


Nicely phrased Claudio! I like it!

I agree. In this instance, I didn't mention any particular
platform-specific library, just a feature common to most general-purpose
operating systems. In the general case, though, I think you've summed
it up nicely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top