Off-topic Talk Where overpaid, underworked S2000 owners waste the worst part of their days before the drive home. This forum is for general chit chat and discussions not covered by the other off-topic forums.

Creating a simple file in Java - what am I doing wrong ?

Thread Tools
 
Old May 30, 2003 | 12:46 PM
  #1  
s2kdriver80's Avatar
Thread Starter
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Nov 2002
Posts: 2,048
Likes: 8
From: Long Island, New York, US
Default 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
Reply
Old May 30, 2003 | 03:36 PM
  #2  
gldneyes6's Avatar
Registered User
 
Joined: Apr 2003
Posts: 156
Likes: 0
From: Huntington Beach
Default

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?
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
s2kdriver80
Off-topic Talk
0
Mar 31, 2003 05:37 AM
mingster
Off-topic Talk
5
Apr 11, 2001 09:26 PM




All times are GMT -8. The time now is 02:19 PM.