Tempfile#size returns 0 under windows

e$B$?$1e(B(tk)e$B$G$9!#e(B

Rails e$B$Ne(B attachment_fue$B%W%i%0%$%s$,e(B
Windowse$B4D6-$G%"%C%W%m!<%I$7$?%U%!%$%ke(B
e$B$N%5%$%:[email protected]$KJV$5$J$$$H$$$&LdBj$,$"$j$^$7$F!"e(B


http://www.google.co.jp/search?hl=ja&q=tempfile.rb+%40tmpfile.fsync&aq=f&aqi=&aql=&oq=&gs_rfai=

e$B$K$h$j$^$9$H!"<!$N$h$&$Ke(B @tmpfile.fsync
e$B$rF~$l$l$P$h$$!"$H$N$3$H$G$9!#e(B

class Tempfile
def size
if @tmpfile
@tmpfile.fsync # added this line
@tmpfile.flush
@tmpfile.stat.size
else
0
end
end
end

e$B$7$+$7!"e(Bruby1.8e$B$N!V0BDjHG%9%J%C%W%7%g%C%He(B(2010/07/03
04:07:09e$B!W$G$b$3$Ne(B
e$B9T$,F~$C$F$$$J$$$h$&$G$9!#e(B

e$B$3$l$Oe(B ruby e$B$N%P%0$J$N$G$7$g$&$+!)e(B e$B$=$l$H$be(B
attachment_fu e$B$NLdBj$J$N$G$7$ge(B
e$B$&$+!)e(B
e$B$^$?!":G?7HG$G$OB>$N2r7hJ}K!$,9V$8$i$l$F$$$k$N$G$7$g$&$+!)e(B

take_tk = kumagai hidetake

[email protected]$G$9!#e(B

At Sun, 4 Jul 2010 01:25:05 +0900,
take_tk wrote in [ruby-dev:41800]:

e$B$7$+$7!"e(Bruby1.8e$B$N!V0BDjHG%9%J%C%W%7%g%C%He(B(2010/07/03 04:07:09e$B!W$G$b$3$Ne(B
e$B9T$,F~$C$F$$$J$$$h$&$G$9!#e(B

e$B$3$l$Oe(B ruby e$B$N%P%0$J$N$G$7$g$&$+!)e(B e$B$=$l$H$be(B attachment_fu e$B$NLdBj$J$N$G$7$ge(B
e$B$&$+!)e(B
e$B$^$?!":G?7HG$G$OB>$N2r7hJ}K!$,9V$8$i$l$F$$$k$N$G$7$g$&$+!)e(B

tempfilee$B0J30$G$b5/$-$k$N$G!"e(BIO#flushe$B$Ge(Bfsync()e$B$9$k$h$&$K$J$j$^$7$?!#e(B

http://redmine.ruby-lang.org/issues/show/776

e$B3F%V%i%s%A$O0J2<$N%j%S%8%g%[email protected]$5$l$F$$$^$9!#e(B
1.8.6: r28003 2010-05-25
1.8.7: r24406 2009-08-05
1.8.8: r24223 2009-07-21
1.9.1: r21035 2008-12-25
1.9.2: r20982 2008-12-25

e$B$?$1e(B(tk)e$B$G$9!#e(B

[ruby-dev:41801] Re: Tempfile#size returns 0 under windows e$B$K$Fe(B
Nobuyoshi N. [email protected] e$B$5$se(B e$B[)$/e(B:

1.9.1: r21035 2008-12-25
1.9.2: r20982 2008-12-25

e$BN;2r$7$^$7$?!#e(B

take_tk = kumagai hidetake

[email protected]$G$9!#e(B

At Mon, 5 Jul 2010 09:13:01 +0900,
KOSAKI Motohiro wrote in [ruby-dev:41810]:

e$B8e3X$N$?$a$K65$($F$/[email protected]$5$$!#e(Bfdatasync()e$B$rHr$1$k$N$Oe(Bportabilitye$BE*$Je(B
e$BM}M3$G$7$g$&$+!)e(B

Windowse$B8BDj$NOC$J$N$G85!9e(Bportabilitye$B$O9MN8$NT?30$G$9$,!“C1$Ke(B
fsync()e$BAjEv$Ne(BFlushFileBufferse$B$7$+$J$/$Fe(Bfdatasync()e$BAjEv$,$J$$$+$ie(B
e$B$G$9!#$=$l$H$be(BWindows
[email protected]$HJL$Ne(BAPIe$B$,DI2C$5$l$F$?$j$H$+!”$=$&$$$&e(B
e$B%P!<%8%g%s4V$Ne(Bportabilitye$B$G$9$+e(B?

tempfilee$B0J30$G$b5/$-$k$N$G!"e(BIO#flushe$B$Ge(Bfsync()e$B$9$k$h$&$K$J$j$^$7$?!#e(B

http://redmine.ruby-lang.org/issues/show/776

e$B3F%V%i%s%A$O0J2<$N%j%S%8%g%[email protected]$5$l$F$$$^$9!#e(B
1.8.6: r28003 2010-05-25
1.8.7: r24406 2009-08-05
1.8.8: r24223 2009-07-21
1.9.1: r21035 2008-12-25
1.9.2: r20982 2008-12-25

e$B8e3X$N$?$a$K65$($F$/[email protected]$5$$!#e(Bfdatasync()e$B$rHr$1$k$N$Oe(Bportabilitye$BE*$Je(B
e$BM}M3$G$7$g$&$+!)e(B

e$B%P!<%8%g%s4V$Ne(Bportabilitye$B$G$9$+e(B?
e$B$9$$$^$;$s!“8mFI$7$F$$$^$7$?!#e(B
e$B%3!<%[email protected]<(E*$Ke(B #ifdef _WIN32
e$B$7$F$”$j$^$9$M!#$F$C$-$je(BOSe$BHs0MB8$Ge(B
fsync()e$B8F$V$h$&$K$7$?$H$$$&OC$+$H;W$C$F$^$7$?!#$9$$$^$;$s!#e(B