home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Shareware / Comunicatii / advwebrank / awr.msi / disk1.cab / bsh_1.2b6.jar / bsh / commands / cd.bsh < prev    next >
Encoding:
Text File  |  2002-05-24  |  384 b   |  21 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.     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.  
  21.