A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA/OCP Java SE 7 Programmer I & II Study Guide
this week in the
Programmer Certification (SCJP/OCPJP)
File Deletion is failing.
Joined: Sep 08, 2006
Jan 24, 2012 02:51:26
I am trying to delete a file.
This is the program for the same.:
File f= new File(file);
System.out.println("File Exits: " +f.exists()+" Files Deleted:"+f.delete());
File Exits:true Files Deleted:false
I also checked for the appropriate permissions.
This file has all permissions.
Can any one help me regarding why this file is not getting deleted.
Any help is always appreciated.
Thanks and Regards,
B.Sc.(I.T.), S.C.J.P., S.C.W.C.D., PGDAC(CDAC)
Joined: May 31, 2011
Jan 24, 2012 05:03:42
Check if you have closed all the streams accessing the file & the file is not kept opened by any other application.
Joined: Jul 09, 2001
Jan 24, 2012 16:08:16
Please have a look at -
How to tell why a file deletion fails in Java?
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
I agree. Here's the link:
subject: File Deletion is failing.
File Delete Problem
Recursive File List - Help me problem solve please
Java deletion sometimes fails on Windows
File object does not detect xml file in a folder
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014