Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File location problem  RSS feed

 
Neo Wills
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!