Guest tkforever Posted April 15, 2004 Share Posted April 15, 2004 This is what I've got basically and during run-time it's not working. /****************************************/ File tk = new File(String path); boolean delCheck = false if(tk.exists()) delCheck = tk.delete(); if(delCheck) System.out.println ("Delete Complete"); else System.out.println ("The file was unable to be deleted"); /****************************************/ I've made sure my buffered reader objects are closed and all file threads are closed. The File exists at the location I'm sure, any suggestions? I must be missing something. thanks tk Link to comment Share on other sites More sharing options...
biggles Posted April 19, 2004 Share Posted April 19, 2004 This is what I've got basically and during run-time it's not working./****************************************/ File tk = new File(String path); boolean delCheck = false if(tk.exists()) delCheck = tk.delete(); if(delCheck) System.out.println ("Delete Complete"); else System.out.println ("The file was unable to be deleted"); /****************************************/ I've made sure my buffered reader objects are closed and all file threads are closed. The File exists at the location I'm sure' date=' any suggestions? I must be missing something. thanks tk[/quote'] Assuming you made the java.io.File import at the beggining of that file, why are you declaring a string here File tk = new File(String path); instead of passing it one? Like File tk = new File("/home/user/file.txt"); 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now