Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!goblin3!goblin.stu.neva.ru!news.sdf.org!.POSTED!not-for-mail From: dagon@dagon.net (Dagon) Newsgroups: comp.lang.java.programmer Subject: Re: deleting files Date: Fri, 28 Jan 2011 14:17:21 -0800 Organization: Dagon.net Lines: 30 Message-ID: References: NNTP-Posting-Host: sverige.freeshell.org X-Trace: droog.sdf-eu.org 1296262500 17895 192.94.73.4 (29 Jan 2011 00:55:00 GMT) X-Complaints-To: usenet@droog.sdf-eu.org NNTP-Posting-Date: Sat, 29 Jan 2011 00:55:00 +0000 (UTC) mail-copies-to: never x-fastest-land-animal: cheetah disclaimer: bears author this post for full responsibility X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: dagon@dagon.net (Dagon) Xref: csiph.com comp.lang.java.programmer:25596 Roedy Green wrote: >I wrote a program to tidy up my hard disk. I run it as administrator. >It tells me there are a fair number of junk files I cannot delete. What does this mean? A File for which delete() returns false? There's a lot of reasons this can happen. >I have a utility, presumably written in C, that much more rapidly scans >my drive for junk and manages to wipe out much of the junk I could >not. Yup. >I curious if anyone has experimented and could tell me: >1. why in the C utility is so much faster than my utility. My code is >basically just a bunch of File.list() with filters. What Java doing to >dither? You don't give us enough information about the utility or your code to expect that anyone's experiments are directly relevant. My WAG is that the utility is using OS-specific calls and knowledge that are faster than the more general abstractions in the JDK. >2. What is the utility doing to let it kill more files? It depends on why you can't delete the files to start with. Most likely it's the same answer: OS-specific knowledge and calls in the utility. -- Mark Rafn dagon@dagon.net