From: nobu.nokada@... Date: 2003-12-17T12:12:55+09:00 Subject: Re: Very odd IO problem Hi, At Wed, 17 Dec 2003 10:21:57 +0900, Brad wrote: > I have a very strange problem. I'm hoping someone can help me with > an answer or at least point me in the right direction. I've been > plagued with this problem for quite sometime now, however, up until > now it has only been an intermittent problem. > > File: [bh.scripts]cwd.rb > print Dir.getwd At first, this script works correctly? Which do you have the problem, with Dir.getwd only or with backticks? Anyhow, perhaps VMS style path names would cause many problems at File.dirname etc. Index: util.c =================================================================== RCS file: /cvs/ruby/src/ruby/util.c,v retrieving revision 1.38 diff -u -2 -p -r1.38 util.c --- util.c 22 Nov 2003 03:59:18 -0000 1.38 +++ util.c 17 Dec 2003 03:11:48 -0000 @@ -638,4 +638,8 @@ ruby_getcwd() { #ifdef HAVE_GETCWD +# ifdef __VMS + char *buf = getcwd(NULL, 0, 0); + if (!buf) rb_sys_fail("getcwd"); +# else int size = 200; char *buf = xmalloc(size); @@ -646,4 +650,5 @@ ruby_getcwd() buf = xrealloc(buf, size); } +# endif #else # ifndef PATH_MAX -- Nobu Nakada