Method: File.exist?
- Defined in:
- file.c
.exist?(file_name) ⇒ Boolean
Return true if the named file exists.
file_name can be an IO object.
“file exists” means that stat() or fstat() system call is successful.
1810 1811 1812 1813 1814 1815 1816 1817 |
# File 'file.c', line 1810
static VALUE
rb_file_exist_p(VALUE obj, VALUE fname)
{
struct stat st;
if (rb_stat(fname, &st) < 0) return Qfalse;
return Qtrue;
}
|