FileDocCategorySizeDatePackage
MkDirExamples.javaAPI DocExample584Wed Jun 16 19:48:36 BST 2004None

MkDirExamples

public class MkDirExamples extends Object
The collected mkdir examples (JavaCook 2e, Recipe 11.9).

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		boolean status;
		status = new File("/home/ian/bin").mkdir();
		report(status);
		status = new File("/home/ian/src").mkdir();
		report(status);

		status = new File("/home/ian/once/twice/again").mkdir();	// should fail
		report(status);
		status = new File("/home/ian/once/twice/again").mkdirs();	// should succeed
		report(status);
	
static voidreport(boolean b)

		System.out.println(b ? "success" : "failure");