This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Created File cannot be Deleted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Created File cannot be Deleted" Watch "Created File cannot be Deleted" New topic

Created File cannot be Deleted

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
If I use code to create a file the file cannot be deleted with code. There are no exceptions thrown. If I manually create the file if delets fine.

My create code:

My delete code:

Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Your delete code deletes the file and then recreates it.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
I agree. Here's the link:
subject: Created File cannot be Deleted
Similar Threads
File Process Fails but Generated No Exception
File Becomes Locked so App Cannot Make Changes to it
Strange File Behavior
File Not Found Problem
Using a Configuration Setting