From: Joel VanderWerf Date: 2008-09-10T07:08:51+09:00 Subject: Re: FileUtils.chdir thread safety ara.t.howard wrote: > > On Sep 9, 2008, at 1:46 PM, Joel VanderWerf wrote: > >> So in the case of >> >> Thread.chdir('foo') {puts `ls`} >> >> the subprocess would be executed in foo ? >> >> This would be very nice, but it seems like a major modification to >> ruby... potentially every system call would need to be aware of the >> thread cwd state. > > > this is already true. if you do > > chdir('foo'){ puts `ls` } > > the command will enter foo, run ls, and exit. the real issue is with I meant that system calls need to be aware of the current thread's own cwd state, as opp. the process cwd. > 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? Yeah. > it seems like an easier ? -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407