home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 June / PCWorld_2007-06_cd.bin / multimedia / ppsee / PPSeeSetup.exe / lib / bsh-commands-2.0b4.jar / bsh / commands / cd.bsh < prev    next >
Text File  |  2005-05-23  |  388b  |  20 lines

  1. /**
  2.     Change working directory for dir(), etc. commands (like Unix cd)
  3. */
  4.  
  5. bsh.help.cd = "usage: cd( path )";
  6.  
  7. /*
  8.     Additions by Kevin Raulerson, http://www.spin.com.mx/~kevinr/
  9. */
  10. void cd( String pathname ) 
  11. {
  12.     this.file = pathToFile( pathname );
  13.  
  14.     if ( file.exists() && file.isDirectory() )
  15.         bsh.cwd = file.getCanonicalPath();
  16.     else
  17.         print( "No such directory: "+pathname);
  18. }
  19.  
  20.