aspose file tools*
The moose likes Java in General and the fly likes exec() with arguments to open a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "exec() with arguments to open a file" Watch "exec() with arguments to open a file" New topic
Author

exec() with arguments to open a file

Alex Hollis
Greenhorn

Joined: Aug 24, 2006
Posts: 5
Hello,

I have a third party CRM system which I would like to integrate with. I really want to launch into a particular record from my java app.

The system includes notifications where the following text file is sent...



... with a file name of my.prospectproblem where .prospectproblem is associated with the program.

I have two problems, the first is I need to know how to pass this to the program without creating the file if possible and secondly how to prevent the program launching twice.

I realise this might involve a step into the native code but any pointers would be great.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Can you start the program from the command line? What does that look like? I'm afraid it might be:

myprogram my.prospectproblem

If so myprogram is probably using file IO to read the file and I don't know any way to fool it into reading from elsewhere.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Alex Hollis
Greenhorn

Joined: Aug 24, 2006
Posts: 5
Thanks for replying Stan, I will try passing the arguments in that manner tomorrow. But I would need to create a file temporally and pass that which I am trying to avoid if possible.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
THen again if the command is

myprogram < my.prospectproblem

we got it made in the shade. Let us know what you find.
Alex Hollis
Greenhorn

Joined: Aug 24, 2006
Posts: 5
Very confusing, I can't pass it the arguments.

I can double click on the my.prospectproblem and it will open the system (or use the already open one). I might ask the vendor if they have command line arguments for passing the information.
Thanks for the advice.
 
Don't get me started about those stupid light bulbs.
 
subject: exec() with arguments to open a file