From: Charles Oliver Nutter Date: 2008-09-10T11:09:40+09:00 Subject: Re: FileUtils.chdir thread safety ara.t.howard wrote: > a thread local 'chdir' would need to affect backticks, system, exec, Dir > methods, FileUtils methods, etc. i guess the first thing scheduling > each thread would need to do is chdir to it's own cwd before running any > code to be safe. this seems *very* expensive doesn't it? JRuby already supports multiple cwd in the same process by doing exactly that, making all filesystem-aware operations use *our* cwd rather than the process cwd. This is, for example, how you can run multiple Rails apps in the same process, concurrently, without them stepping on each other; they each get their own virtual cwd. We could ignore implementation details for the moment, couldn't we? It would be nice to have. - Charlie