Beyond
1
Beyonde$B$G$9!#e(B
cygwine$B$@$1$@$H;W$$$^$9$,!"<!$N$h$&$J%9%/%j%W%H$Ge(Bcoree$B$r$O$-$^$9!#e(B
$ ruby mv.rb
mv.rb:5: [BUG] rb_sys_fail(b or a) - errno == 0
ruby 1.8.5 (2006-08-06) [i386-cygwin]
Aborted (core dumped)
------------------------------ mv.rb
#! ruby
Dir.mkdir( “a” )
File.open( “b”, “w” ) { |f| f.puts “1” }
File.rename( “b”, “a” )
Beyond
2
e$B$J$+$@$G$9!#e(B
At Fri, 18 Aug 2006 09:52:59 +0900,
Beyond wrote in [ruby-dev:29293]:
cygwine$B$@$1$@$H;W$$$^$9$,!"<!$N$h$&$J%9%/%j%W%H$Ge(Bcoree$B$r$O$-$^$9!#e(B
$ ruby mv.rb
mv.rb:5: [BUG] rb_sys_fail(b or a) - errno == 0
ruby 1.8.5 (2006-08-06) [i386-cygwin]
Aborted (core dumped)
e$B$I$&$d$i!“e(Brename()e$B$Ge(Berrnoe$B$,%;%C%H$5$l$J$$$H$$$&%P%0$O!”:G6a$Ne(B
cygwine$B$G$OD>$C$F$$$k$h$&$G$9!#e(B
Index: file.c
RCS file: /pub/cvs/ruby/src/ruby/file.c,v
retrieving revision 1.169.2.48
diff -U 2 -p -u -r1.169.2.48 file.c
— file.c 17 Aug 2006 10:15:55 -0000 1.169.2.48
+++ file.c 18 Aug 2006 03:45:56 -0000
@@ -2233,8 +2233,13 @@ rb_file_s_rename(klass, from, to)
src = StringValueCStr(from);
dst = StringValueCStr(to);
+#if defined CYGWIN
- errno = 0;
+#endif
if (rename(src, dst) < 0) {
#if defined CYGWIN
extern unsigned long attribute((stdcall)) GetLastError(void);
- errno = GetLastError(); /* This is a Cygwin bug */
Beyond
3
e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B
In message “Re: [ruby-dev:29297] Re: File.rename”
on Fri, 18 Aug 2006 12:47:48 +0900, [email protected] writes:
|e$B$I$&$d$i!“e(Brename()e$B$Ge(Berrnoe$B$,%;%C%H$5$l$J$$$H$$$&%P%0$O!”:G6a$Ne(B
|cygwine$B$G$OD>$C$F$$$k$h$&$G$9!#e(B
e$B%3%_%C%H$7$F$/$@$5$$!#e(B