Hello,

I've hit one snag regarding how the servlet containers handle filesystem
path names migrating a servlet from:

ApacheJServ/1.1.2 (FreeBSD 3.4)

to:

Tomcat Web Server/3.1 (JSP 1.1; Servlet 2.2; Java 1.2.2; SunOS 5.8 sparc;
java.vendor=Sun Microsystems Inc.)

My doGet() contains these lines:

-----

PrintWriter outfile = new PrintWriter(new BufferedWriter(new
                                      FileWriter("out.txt", true)));
outfile.print(sexString + csv + ageString + csv +
              crString + csv + wtString + csv +
              new Float(answer).toString() + "\r\n");
outfile.close();

-----

1. On the ApacheJserv machine, I can use:
FileWriter("/any/directory/nobody/can/write/to/out.txt");
And out.txt turns up at that exact path in the filesystem.

2. Trying to use an absolute path with Tomcat generates a runtime
exception if the directory "doesn't exist", but I can't understand where
Tomcat is looking because even "/tmp/out.txt" doesn't work.

3. Under Tomcat, it *seems* to be writing if I use a relative pathname,
say "out.txt", but I can't find the file.


Could someone put me out of my misery and explain Tomcat's view of the
filesystem to me?


--
Paul.

mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to