• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Deleting files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Deleting files


  • Subject: RE: Deleting files
  • From: jim <email@hidden>
  • Date: Thu, 16 Jan 2003 13:54:10 -0500

This works for directories as well as files.

import java.io.*;

public class Delete_the_Sucker{

	public static void main (String filename) {
		File file = new File (filename); // or directory

		if (!file.delete()){
			System.out.println(file.getName() +" cannot be delete");
		}
	}
}


If you have an instance of a file......then it contains a method delete() to call to remove the file.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Error - lockRowComparingAttributes
  • Next by Date: Re: WO 5.2 Prmiary Key Problems
  • Previous by thread: Re: File System - Adding and Deleting files/DIR's In Web Server Resources
  • Next by thread: RE: Deleting files
  • Index(es):
    • Date
    • Thread