FileDocCategorySizeDatePackage
ExecDemoFiles.javaAPI DocExample581Mon Apr 30 12:07:12 BST 2001None

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");