bsh.commands.rm.bsh Maven / Gradle / Ivy
The newest version!
/**
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 - 2024 Weber Informatics LLC | Privacy Policy