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
/
sourceRelative.bsh
< prev
next >
Wrap
Text File
|
2005-05-23
|
632b
|
22 lines
/**
Source a file relative to the callering script's directory.
<p/>
e.g. scripts A running in dir A sources script B in dir B.
Script B can use this command to load additional scripts (data, etc.)
relative to its own location (dir B) without having to explicitly know
its "home" directory (B).
<p/>
Note: this only works for files currently.
@since bsh1.3
@see source( file | URL );
*/
sourceRelative( String file )
{
this.dir=dirname( getSourceFileInfo() );
this.path=pathToFile( dir + File.separator + file ) .getAbsolutePath();
return this.interpreter.source( path, this.caller.namespace );
}