Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Runtime.getRuntime().exec() problem - How to read an input file

807606Mar 7 2007 — edited Mar 8 2007
i use "Runtime.exec()" to call qmail-inject on Linux, I have to pass the message
body to qmail inside java, how would I do it. I am
desperate since it won't read anything from
message.txt, it just won't read anything from "< message.txt"
It end up sending a blank email.

Process proc =
runtime.exec("/var/qmail/bin/qmail-inject
nwa001@somedomain.com < message.txt");

So how to pass a file to a executale inside exec? the "<" pipeline obviously not working!

Thanks ahead!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2007
Added on Mar 7 2007
2 comments
3,060 views