> Here is my code: > > #include <fstream> > using namespace std; > > int main (int argc, char* argv[]) > { > ofstream out; > > out.open("/root/test.data"); > > for (int x = 0; x < argc; x++) > out << argv[x]; > out.close(); > return 0; > > } > > It works fine from the command line, but when I try to send mail to it > the file isn't written...
You're probably looking at a permissions problem. Sendmail (and other mailers) typically run as non-root. Therefore when you are trying to open /root/test.data it's probably failing miserably, throwing an exception, and bailing. Try changing to /tmp/test.data and see what happens. -- gentoo-user@gentoo.org mailing list