Creating a simple file in Java - what am I doing wrong ?
I'm trying to create a file in java using the line -
File myFile = new File( "C:test.txt" );
and it does not work. The file doesn't show and when I invoke isFile() or exists() on the myFile object, it returns false. I remember doing this in my classes and it was very simple - an empty file with that name should pop up in C: Does anyone know what I'm doing wrong? TIA
File myFile = new File( "C:test.txt" );
and it does not work. The file doesn't show and when I invoke isFile() or exists() on the myFile object, it returns false. I remember doing this in my classes and it was very simple - an empty file with that name should pop up in C: Does anyone know what I'm doing wrong? TIA
I presume it just doesn't show up as an existing file ... I presume it's an application?
you can always use File.separator rather than having the slashes ...
offhand it looks how I remember using it. Maybe there is a security policy in place? if you needed it to create a new file there is file.createNewFile()?
maybe post a bigger chunk of code since it looks ok?
you can always use File.separator rather than having the slashes ...
offhand it looks how I remember using it. Maybe there is a security policy in place? if you needed it to create a new file there is file.createNewFile()?
maybe post a bigger chunk of code since it looks ok?
Thread
Thread Starter
Forum
Replies
Last Post
mingster
Off-topic Talk
5
Apr 11, 2001 09:26 PM







