Sha256: a06d313ea3ab8407ce62242d2cb4fe29107b82e642aeebb69b838f68183697da

Contents?: true

Size: 535 Bytes

Versions: 6

Compression:

Stored size: 535 Bytes

Contents

VALUE rb_cFile;

/*
 * call-seq:
 *    File.exist?(file_name)    ->  true or false
 *
 * Return <code>true</code> if the named file exists.
 *
 * _file_name_ can be an IO object.
 *
 * "file exists" means that stat() or fstat() system call is successful.
 */

static VALUE
rb_file_exist_p(VALUE obj, VALUE fname)
{
    struct stat st;

    if (rb_stat(fname, &st) < 0) return Qfalse;
    return Qtrue;
}

void
Init_File(void)
{
	rb_cFile = rb_define_class("File", rb_cIO);
    define_filetest_function("exist?", rb_file_exist_p, 1);
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
yard-0.9.24 spec/parser/examples/file.c.txt
yard-0.9.23 spec/parser/examples/file.c.txt
yard-0.9.22 spec/parser/examples/file.c.txt
yard-0.9.21 spec/parser/examples/file.c.txt
yard-0.9.20 spec/parser/examples/file.c.txt
yard-0.9.19 spec/parser/examples/file.c.txt