
bsh.commands.rm.bsh Maven / Gradle / Ivy
/**
Remove a file (like Unix rm).
*/
bsh.help.rm = "usage: cd( path )";
boolean rm( String pathname )
{
this.file = pathToFile( pathname );
if ( file == null )
throw new java.io.FileNotFoundException("pathname");
if ( file.isDirectory() ) {
print( pathname + "is a directory" );
return;
}
return file.delete();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy