On Dec 21, 2007, at 1:13 PM, felix wrote:
... and the error printout becomes useless for troubleshooting. I'm not sure we want to make that a general situation.
Not messy at all. Just save the old path in the method and restore it at cleanup, like Environment:use does. executeFile { arg pathName ... args; var result, saveExecutingPath = thisProcess.nowExecutingPath; if (File.exists(pathName).not) { ["file \"",pathName,"\" does not exist."].join.postln; ^nil }; thisProcess.nowExecutingPath = pathName; protect { result = this.compileFile(pathName).valueArray(args) } { thisProcess.nowExecutingPath = saveExecutingPath }; ^result } (That's a change from what I committed before... um, not just "change"... improvement :) and it has benefits for other code elsewhere Yes... I'm using it in chucklib so that all the preloaded objects know where they were defined. hjh : H. James Harkins : jamshark70@xxxxxxxxxxxxxxxxx : http://www.dewdrop-world.net .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman |