ruby-changes:67178
From: Akinori <ko1@a...>
Date: Tue, 17 Aug 2021 21:46:47 +0900 (JST)
Subject: [ruby-changes:67178] 4814528296 (master): [DOC] Fix the rdoc for File::Stat#size? [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=4814528296 From 48145282969230ba4a7c8cc7a6aedfd1263900c4 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA <knu@i...> Date: Tue, 17 Aug 2021 21:44:41 +0900 Subject: [DOC] Fix the rdoc for File::Stat#size? [ci skip] --- file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/file.c b/file.c index 4ea8de6..41ebf86 100644 --- a/file.c +++ b/file.c @@ -6063,11 +6063,13 @@ rb_stat_z(VALUE obj) https://github.com/ruby/ruby/blob/trunk/file.c#L6063 /* * call-seq: - * state.size -> integer + * stat.size? -> Integer or nil * - * Returns the size of <i>stat</i> in bytes. + * Returns +nil+ if <i>stat</i> is a zero-length file, the size of + * the file otherwise. * - * File.stat("testfile").size #=> 66 + * File.stat("testfile").size? #=> 66 + * File.stat("/dev/null").size? #=> nil * */ -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/