Did you use the localhost? Have you tried the directory under C:\Apache_Tomcat\work\localhost\_. I guess that one probably the "current directory" though I did not try it.
Otherwise, you may have to use an absolute path
 
Regards
 
John  
-----Original Message-----
From: Piotrek [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 05, 2002 2:07 AM
To: [EMAIL PROTECTED]
Subject: Problem with files

Hi all
I have the following problem:
I need to read/write a file for a servlet, both are in my WEB-INF/classes directory. I use the code below:
String filename="myfile.abc";
File f=new File(filename);
RandomAccessFile raf=new RandomAccessFile(f);
 
but it doesn't work, it seems like the file is created somewhere in memory. Everything works fine when is used in an ordinary java class.
When I change the filename to be an absolute path it also works fine:
String filename="D:\\tomcat\\webapps\\ROOT\\WEB-INF\\classes\\";
....
What am I doing wrong?
 
With best regards
Thank you in advance
Piotr Bieganowski

Reply via email to