Siena. ?????B

ruby 1.8.1 preview2+ (CVS HEAD) ?? OS/2 V4.51 with EMX 0.9d ??
?r???h???????????g???????????B

???????????P???h???C?u????????????X?N???v?g????????????????????????
?C?t???????????????????A?h???C?u?????????????J?????g?f?B???N?g????
???X?????X?N???v?g?????????????????????????B??????p?b?`??
???????????????A???????????????????????????????????????????B


????????????A???????? cmd.exe ?????l???h???C?u???^?[?????????????????????A
?p?X?????h???C?u???^?[???????????A?J?????g?h???C?u?????X???????????B
???????????????b?V?F???? cd ???h???C?u?????X?????????????????????????????B

$ cd F:/home ; cd E:/os2 ; ruby -e 'Dir.chdir("F:") ; puts Dir.pwd'
-e:1:in `chdir': No such file or directory - F: (Errno::ENOENT)
        from -e:1

$ cd F:/home ; cd E:/os2 ; ruby -e 'Dir.chdir("F:.") ; puts Dir.pwd'
/os2   ## ?J?????g?h???C?u?? E: ??????

$ cd F:/home ; cd E:/os2
$ ruby -e 'Dir.chdir("F:/") ; puts Dir.pwd ; puts `cmd /c cd F:`'
/os2   ## ?J?????g?h???C?u?? E: ??????
F:\    ## F: ???J?????g?f?B???N?g???????X??????????


EMX ?????C?u???????t?@?????X???m?F???????Achdir(), getcwd() ???????A
?h???C?u???^?[?????? _chdir2(), _getcwd2() ???g???K?v???????????????B
?????????????Amissing/os2.c ?? chdir(), getcwd() ???????`????
_chdir2(), _getcwd2() ?????????????????????????B
????e?X?g?R?[?h?????}???????????s???????????m?F?????????B

$ cd F:/home ; cd E:/os2 ; ruby -e 'Dir.chdir("F:") ; puts Dir.pwd'
F:/home

$ cd F:/home ; cd E:/os2 ; ruby -e 'Dir.chdir("F:.") ; puts Dir.pwd'
F:/home

$ cd F:/home ; cd E:/os2
$ ruby -e 'Dir.chdir("F:/") ; puts Dir.pwd ; puts `cmd /c cd F:`'
F:/
F:\


?????Aruby/missing/os2.c ?????????p?b?`???Y?t???????B
automake 2.50 ?????W???[?? OS/2 ?|?[?g???????????}?N??
EMX_REPLACE_GETCWD ?? EMX_REPLACE_CHDIR ?????p???????????B
EMX_REPLACE_GETCWD ???Agetcwd() ???h???C?u???^?[?????????A
?h???C?u???^?[?????? _getcwd2() ?????????????????`?????????B
EMX_REPLACE_CHDIR ???Achdir(), _chdir2() ???????????l?????B
_getcwd2() ?????????????????? int ???????L???X?g?????????????B


# ?????????A[ruby-dev:21765] ???K?????????p???????????? ^^;?
---
Siena. <mailto:siena / faculty.chiba-u.jp>

Index: ruby/missing/os2.c =================================================================== RCS file: /src/ruby/missing/os2.c,v retrieving revision 1.3 diff -u -p -2 -r1.3 os2.c --- ruby/missing/os2.c 6 Mar 2001 08:17:18 -0000 1.3 +++ ruby/missing/os2.c 12 Nov 2003 08:25:04 -0000 @@ -24,4 +24,27 @@ link(char *from, char *to) } +#if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD) \ + || defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR) +#include <unistd.h> + +#if defined(EMX_REPLACE_GETCWD) && (EMX_REPLACE_GETCWD) +/* to handle the drive letter and DBCS characters within a given path */ +char * +getcwd(char *path, size_t len) +{ + return _getcwd2(path, (int)len); +} +#endif + +#if defined(EMX_REPLACE_CHDIR) && (EMX_REPLACE_CHDIR) +/* to handle the drive letter and DBCS characters within a given path */ +int +chdir(__const__ char *path) +{ + return _chdir2(path); +} +#endif +#endif + typedef char* CHARP;