FileDocCategorySizeDatePackage
ExecDemoFiles.javaAPI DocExample579Sat Mar 13 14:24:02 GMT 2004None

ExecDemoFiles

public class ExecDemoFiles extends Object
Create, list and remove some files

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

		
		// Get and save the Runtime object.
		Runtime rt = Runtime.getRuntime();

		// Create three temporary files
		rt.exec("mktemp file1");
		rt.exec("mktemp file2");
		rt.exec("mktemp file3");

		// Run the "ls" (directory lister) program
		// with its output sent into a file
		String[] args = { "ls", "-l", "file1", "file2", "file3" };
		ExecAndPrint.run(args);

		rt.exec("rm file1 file2 file3");