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:
parent
dba42e07b5
commit
ec35b84429
2 changed files with 13 additions and 0 deletions
|
@ -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>
|
||||
|
||||
* win32/win32.h (S_I?USR): define only if not mingw32.
|
||||
|
|
|
@ -85,6 +85,15 @@ class Tempfile < SimpleDelegator
|
|||
def path
|
||||
@tmpname
|
||||
end
|
||||
|
||||
def size
|
||||
if @tmpfile
|
||||
@tmpfile.flush
|
||||
@tmpfile.stat.size
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if __FILE__ == $0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue