PageRenderTime 53ms CodeModel.GetById 50ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/bsh/commands/rm.bsh

#
Unknown | 20 lines | 14 code | 6 blank | 0 comment | 0 complexity | 85ad2f687e6c15fb6c647845c3a09388 MD5 | raw file
 1/**
 2	Remove the file (like Unix rm)
 3*/
 4
 5bsh.help.rm = "usage: cd( path )";
 6
 7void rm( String pathname ) {
 8    file = pathToFile( pathname );
 9
10	if ( file == null )
11		throw new java.io.FileNotFoundException("pathname");
12
13    if ( file.isDirectory() ) {
14        print( pathname + "is a directory" );
15        return;
16    }
17
18	return file.delete();
19}
20