Forums Register Login

file.delete works most of the time, but fails every so often

+Pie Number of slices to send: Send
hi all. i'm not sure why this erratic behavior is happening. my program downloads zip files from an ftp server, unzips them to a temp directory, processes the text files in the temp dir, and then finally cleans out the temp directory. About 95% of the time, it's able to clean out the temp directory successfully, but every once in a while, it'll run into a file that it can't delete. When that happens, I have to login to windows and delete the rest of the files manually. In the program, i have a bufferedreader that's reading the contents of each text file, and I'm closing the bufferedreader every time i'm done with it. So, if it's not a problem with closing the handle to the file, what else could it be? Also, there are no other processes on this machine that are taking control of these text files; it's just my program. any help would be greatly appreciated! thanks
+Pie Number of slices to send: Send
Chances are it's your code, but it's impossible to say since there isn't any to look at. I've never had *any* issues with deleting files through Java that weren't caused by code, another process, etc. Doesn't mean you're *not*, but I'm skeptical.
+Pie Number of slices to send: Send
after the program unzips the zip files, it goes through and parses each of the text files. Here's the parsing:

+Pie Number of slices to send: Send
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.
+Pie Number of slices to send: Send
sorry, my bad. code looks much better now!
What does a metric clock look like? I bet it is nothing like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1043 times.
Similar Threads
Clean up temp files in Weblogic?
file could not be deleted
Is my problem because of 'StringBuilder'? Or do I need to some memory management (somehow)?
Probelm in FTP ing a FIle
File
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 10:23:09.