1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/tempfile.rb: Merge from 1.7: Add Tempfile#size.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2002-09-11 07:17:18 +00:00
parent dba42e07b5
commit ec35b84429
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Wed Sep 11 16:15:06 2002 Akinori MUSHA <knu@iDaemons.org>
* lib/tempfile.rb: Merge from 1.7: Add Tempfile#size.
Mon Sep 9 23:43:33 2002 WATANABE Hirofumi <eban@ruby-lang.org> Mon Sep 9 23:43:33 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* win32/win32.h (S_I?USR): define only if not mingw32. * win32/win32.h (S_I?USR): define only if not mingw32.

View file

@ -85,6 +85,15 @@ class Tempfile < SimpleDelegator
def path def path
@tmpname @tmpname
end end
def size
if @tmpfile
@tmpfile.flush
@tmpfile.stat.size
else
0
end
end
end end
if __FILE__ == $0 if __FILE__ == $0