-
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()
-
http://java.sun.com/j2se/1.3/docs/ap...le.html#delete()
Is it throwing an exception or just returning the wrong value?
-
No it's just not deleting the file specified. :eek:
-
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.