/jEdit/tags/jedit-4-2-pre4/bsh/commands/cd.bsh
# · Unknown · 19 lines · 15 code · 4 blank · 0 comment · 0 complexity · df823e5efaae63578c5cab2ab03ae594 MD5 · raw file
- /**
- Change working directory for dir(), etc. commands (like Unix cd)
- */
- bsh.help.cd = "usage: cd( path )";
- /*
- Additions by Kevin Raulerson, http://www.spin.com.mx/~kevinr/
- */
- void cd( String pathname )
- {
- this.file = pathToFile( pathname );
- if ( file.exists() && file.isDirectory() )
- bsh.cwd = file.getCanonicalPath();
- else
- print( "No such directory: "+pathname);
- }