Help creating a file with jsp

M

Mike

In a jsp I tried:

String error="";
boolean success = false;

try {


filename="/home/mydir/temp.txt";
File myfile = new File(filename);
success = myfile.createNewFile();


} catch (IOException e) {
error= e + "";
}



I get:

success=false;

error=java.io.IOException: No such file or directory
/home/mydir/temp.txt


Permissions ok
 
M

Mike

On Mon, 06 Feb 2006 18:37:22 GMT, (e-mail address removed) (Mike) wrote:


Sorry, I guess permissions was a problem after all. When I tried a
file name of "/tmp/temp.txt" it worked. (os Linux)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top