Article View: borland.public.jbuilder.java.language
Article #19619Deleting an entire directory?
From: Christopher J. Philpot
Date: Wed, 14 Jan 1998 00:00
Date: Wed, 14 Jan 1998 00:00
20 lines
1294 bytes
1294 bytes
Hey, I noticed that the File class in the JDK does not have a method for deleting full directories. I have been trying for about 3 hours to create my own delete full directory method, but have been having major problems. I decided that I need to search the files in the directory I want to delete, delete all the empty directories and regular files(pretty easy), then look for subdirectories that contain files and other subdirectories and delete those, then go into the subdirectories in that subdirectory that contain files and other subdirectories... It gets pretty complicated :). So here's my question. Has anyone already had to do this and have some source code you could post? I have no idea why Sun didn't just add a File.deleteDirectory class. Please let me know! Thanks, Christopher Philpot
Technical Details
Message-ID:
<34BD1AB8.FB6D981@usa.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,9580f22e3b244237,start X-Google-Attributes: gidf74b3,public From: "Christopher J. Philpot" <cphilpot@usa.net> Subject: Deleting an entire directory? Date: 1998/01/14 Message-ID: <34BD1AB8.FB6D981@usa.net> X-Deja-AN: 315945139 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: None Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language