source: trunk/j/src/bsh/commands/load.bsh @ 2

Last change on this file since 2 was 2, checked in by piso, 18 years ago

Initial checkin.

File size: 400 bytes
Line 
1
2bsh.help.load = "usage: load(filename)";
3
4Object load( String filename ) {
5  file = pathToFile( filename );
6
7  Object obj;
8  FileInputStream in = new FileInputStream( file );
9  ObjectInputStream oin = new ObjectInputStream(in);
10  obj = oin.readObject();
11  oin.close();
12
13  // bind bsh objects into the caller's namespace
14  if ( obj instanceof bsh.This )
15    bind( obj, this.caller.namespace );
16
17  return obj;
18}
Note: See TracBrowser for help on using the repository browser.