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

# · Unknown · 17 lines · 11 code · 6 blank · 0 comment · 0 complexity · 456a26fee044fc125f07c7a67d499f16 MD5 · raw file

  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. }