|
-
Dec 15th, 2001, 11:12 AM
#1
Thread Starter
Dazed Member
Deleting files?
Does anyone know how to delete a file?
I have a JTextField which takes a user defined path. After i read the file i want to delete it but for some reason the delete() method doesnt work. I know there is a deleteOnExit() method but i need to have the file deleted during program execution.
File filepath = new File(jtf.getText()); // should have .txt extension
filepath.delete()
-
Dec 15th, 2001, 11:36 AM
#2
Member
http://java.sun.com/j2se/1.3/docs/ap...le.html#delete()
Is it throwing an exception or just returning the wrong value?
-
Dec 15th, 2001, 11:44 AM
#3
Thread Starter
Dazed Member
No it's just not deleting the file specified.
Last edited by Dilenger4; Dec 15th, 2001 at 12:09 PM.
-
Dec 15th, 2001, 12:08 PM
#4
Thread Starter
Dazed Member
I have a simple encryption/decryption program. I take a file with a .txt extension, encrypt the data (then i want to delete that file)
next i write that encrypted data to another file with a diffrent extension. The reverse is the same i take the file with the new extension decrypt the data (now i want to delete the file with the new extension) and store the data back to the orgional file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|