From: stephen.hill@... (Steve Hill) Date: 2001-10-29T21:00:53+09:00 Subject: [ruby-talk:23719] Re: Dir.chdir behaviour (was `pwd` behaviour in ruby?) Hi, I think I have traced the source of the problem that I have been having. (in ruby 1.6.2) delaware% irb irb(main):001:0> Dir.pwd "/tmp_mnt/home/stehill1/tmp" irb(main):002:0> `pwd` "/tmp_mnt/home/stehill1/tmp\n" irb(main):003:0> `bash -c pwd` "/home/stehill1/tmp\n" irb(main):004:0> `mkdir test` "" irb(main):006:0> Dir.chdir "test" 0 irb(main):007:0> Dir.pwd "/tmp_mnt/home/stehill1/tmp/test" irb(main):008:0> `bash -c pwd` "/tmp_mnt/home/stehill1/tmp/test\n" Dir.chdir is switching to the absolute, hardware defined path when it is invoked. OK, so Dir.pwd thinks it is in the absolute, hardware defined path to start with. Personally I find it rather inconvenient, since it makes it very hard for me to pass directory names round a load balanced system across a dozen or so unix boxes with different hardware mount points e.g. on one machine, /foo appears as /export/data/foo but elsewhere, /foo appears as /mnt/nfs/foo Is there any chance of making ruby's Dir class configurable, so the behaviour of Dir.pwd, Dir.chdir can be made appropriate for the system one is running on? Best regards Steve