| Author |
File location problem
|
Neo Wills
Ranch Hand
Joined: Nov 29, 2006
Posts: 40
|
|
Hi, I am using a Tomcat4.1...This is the problem that I am facing: I have a exe which is to be run by the servlet.The exe uses the files in the current directory and generates files in the current directory. But I have no idea which is the current directory from which the servlet is executed. I tried placing them in the WEB-INF\Classes....But I guess thats not the current dir from which the servlet runs... Can some one help me out with this.. Thanks, Bharath
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56172
|
|
There is no concept of a current diretory in web apps. Search this forum for uses of the methods getRealPath and getResourceAsStream methods. One of these should be able to help you out.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16482
|
|
|
If you are using the Runtime.exec() method to execute this program then you could use the version that allows you to specify its current working directory.
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: File location problem
|
|
|