APIdock / Ruby
/
method

empty?

ruby latest stable - Class: FileTest
empty?(p1)
public

Returns true if the named file exists and has a zero size.

file_name can be an IO object.

static VALUE
rb_file_zero_p(VALUE obj, VALUE fname)
{
 struct stat st;
 if (rb_stat(fname, &st) < 0) return Qfalse;
 if (st.st_size == 0) return Qtrue;
 return Qfalse;
}

AltStyle によって変換されたページ (->オリジナル) /