PageRenderTime 29ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre3/bsh/commands/rm.bsh

#
Unknown | 17 lines | 11 code | 6 blank | 0 comment | 0 complexity | 456a26fee044fc125f07c7a67d499f16 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. bsh.help.rm = "usage: cd( path )";
  2. rm( String pathname ) {
  3. file = pathToFile( pathname );
  4. if ( file == null )
  5. throw new java.io.FileNotFoundException("pathname");
  6. if ( file.isDirectory() ) {
  7. print( pathname + "is a directory" );
  8. return;
  9. }
  10. return file.delete();
  11. }