PageRenderTime 95ms CodeModel.GetById 93ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/bsh/commands/rm.bsh

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