On 10/09/2008, Charles Oliver Nutter <charles.nutter / sun.com> wrote:
> Robert Klemme wrote:
>
> > 2008/9/10 Michal Suchanek <hramrach / centrum.cz>:
> >
> > > Also this could possibly be an option - load thread/chdir and now you
> > > can control if your thread cwds are bound together or not.
> > >
> >
> > This is a good option.  It also carries potential for subtle bugs if
> > it /redefines/ behavior of Dir.chdir.  Maybe better have Thread.chdir
> > instead which delegates to Thread.current.chdir to keep both separate.
> >
>
>  I figured Thread.chdir would only operate on the current thread either way,
> like Thread.stop. And I'd rather not make it possible to change the dir for
> another thread...that seems like a dangerous idea.

If you allow global chdir that's technically chnging the cwd for other threads.

I had a vague idea that there could be an option that controls if cwd
should be emulated ( saved/restored on thread switch or restored for
syscalls that need it) or the global cwd should be used.

Thanks

Michal