file.c File Reference

#include "missing/file.h"
#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/util.h"
#include "dln.h"
#include "internal.h"
#include <sys/param.h>
#include <ctype.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>

Go to the source code of this file.

Data Structures

struct  chown_args
struct  utime_args
struct  utimbuf

Defines

#define STAT(p, s)   rb_w32_ustati64((p), (s))
#define lstat(p, s)   rb_w32_ustati64((p), (s))
#define access(p, m)   rb_w32_uaccess((p), (m))
#define chmod(p, m)   rb_w32_uchmod((p), (m))
#define chown(p, o, g)   rb_w32_uchown((p), (o), (g))
#define utime(p, t)   rb_w32_uutime((p), (t))
#define link(f, t)   rb_w32_ulink((f), (t))
#define unlink(p)   rb_w32_uunlink(p)
#define rename(f, t)   rb_w32_urename((f), (t))
#define rb_sys_fail_path(path)   rb_sys_fail_str(path)
#define insecure_obj_p(obj, level)   ((level) >= 4 || ((level) > 0 && OBJ_TAINTED(obj)))
#define ST2UINT(val)   ((val) & ~(~1UL << (sizeof(val) * CHAR_BIT - 1)))
#define NUM2DEVT(v)   NUM2UINT(v)
#define DEVT2NUM(v)   UINT2NUM(v)
#define PRI_DEVT_PREFIX   ""
#define S_IXUGO   (S_IXUSR | S_IXGRP | S_IXOTH)
#define S_ISBLK(m)   (0)
#define S_ISCHR(m)   (((m) & S_IFMT) == S_IFCHR)
#define S_IRUGO   (S_IRUSR | S_IRGRP | S_IROTH)
#define S_IWUGO   (S_IWUSR | S_IWGRP | S_IWOTH)
#define S_ISREG(m)   (((m) & S_IFMT) == S_IFREG)
#define rb_file_s_lchmod   rb_f_notimplement
#define rb_file_s_lchown   rb_f_notimplement
#define utime_failed(path, tsp, atime, mtime)   rb_sys_fail_path(path)
#define rb_file_s_link   rb_f_notimplement
#define rb_file_s_symlink   rb_f_notimplement
#define rb_file_s_readlink   rb_f_notimplement
#define isdirsep(x)   ((x) == '/')
#define USE_NTFS   1
#define istrailinggarbage(x)   ((x) == '.' || (x) == ' ')
#define has_unc(buf)   0
#define nextdirsep   rb_path_next
#define skipprefix(path)   (path)
#define strrdirsep   rb_path_last_separator
#define BUFCHECK(cond)
#define BUFINIT()
#define EXPAND_PATH_BUFFER()   rb_usascii_str_new(0, MAXPATHLEN + 2)
#define check_expand_path_args(fname, dname)
#define fncomp   strncmp
#define rb_file_s_truncate   rb_f_notimplement
#define rb_file_truncate   rb_f_notimplement
#define LOCK_SH   1
#define LOCK_EX   2
#define LOCK_NB   4
#define LOCK_UN   8
#define CHECK(n)   test_check((n), argc, argv)
#define ENABLE_PATH_CHECK   1
#define S_IWOTH   002
#define fpath_check(path)   path_check_0((path), FALSE)

Functions

int flock (int, int)
static VALUE file_path_convert (VALUE name)
static VALUE rb_get_path_check (VALUE obj, int level)
VALUE rb_get_path_no_checksafe (VALUE obj)
VALUE rb_get_path (VALUE obj)
VALUE rb_str_encode_ospath (VALUE path)
static long apply2files (void(*func)(const char *, VALUE, void *), VALUE vargs, void *arg)
static VALUE rb_file_path (VALUE obj)
static size_t stat_memsize (const void *p)
static VALUE stat_new_0 (VALUE klass, struct stat *st)
static VALUE stat_new (struct stat *st)
static struct stat * get_stat (VALUE self)
static struct timespec stat_mtimespec (struct stat *st)
static VALUE rb_stat_cmp (VALUE self, VALUE other)
static VALUE rb_stat_dev (VALUE self)
static VALUE rb_stat_dev_major (VALUE self)
static VALUE rb_stat_dev_minor (VALUE self)
static VALUE rb_stat_ino (VALUE self)
static VALUE rb_stat_mode (VALUE self)
static VALUE rb_stat_nlink (VALUE self)
static VALUE rb_stat_uid (VALUE self)
static VALUE rb_stat_gid (VALUE self)
static VALUE rb_stat_rdev (VALUE self)
static VALUE rb_stat_rdev_major (VALUE self)
static VALUE rb_stat_rdev_minor (VALUE self)
static VALUE rb_stat_size (VALUE self)
static VALUE rb_stat_blksize (VALUE self)
static VALUE rb_stat_blocks (VALUE self)
static struct timespec stat_atimespec (struct stat *st)
static VALUE stat_atime (struct stat *st)
static VALUE stat_mtime (struct stat *st)
static struct timespec stat_ctimespec (struct stat *st)
static VALUE stat_ctime (struct stat *st)
static VALUE rb_stat_atime (VALUE self)
static VALUE rb_stat_mtime (VALUE self)
static VALUE rb_stat_ctime (VALUE self)
static VALUE rb_stat_inspect (VALUE self)
static int rb_stat (VALUE file, struct stat *st)
static HANDLE w32_io_info (VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
static VALUE rb_file_s_stat (VALUE klass, VALUE fname)
static VALUE rb_io_stat (VALUE obj)
static VALUE rb_file_s_lstat (VALUE klass, VALUE fname)
static VALUE rb_file_lstat (VALUE obj)
static int rb_group_member (GETGROUPS_T gid)
int eaccess (const char *path, int mode)
static int access_internal (const char *path, int mode)
VALUE rb_file_directory_p (VALUE obj, VALUE fname)
static VALUE rb_file_pipe_p (VALUE obj, VALUE fname)
static VALUE rb_file_symlink_p (VALUE obj, VALUE fname)
static VALUE rb_file_socket_p (VALUE obj, VALUE fname)
static VALUE rb_file_blockdev_p (VALUE obj, VALUE fname)
static VALUE rb_file_chardev_p (VALUE obj, VALUE fname)
static VALUE rb_file_exist_p (VALUE obj, VALUE fname)
static VALUE rb_file_readable_p (VALUE obj, VALUE fname)
static VALUE rb_file_readable_real_p (VALUE obj, VALUE fname)
static VALUE rb_file_world_readable_p (VALUE obj, VALUE fname)
static VALUE rb_file_writable_p (VALUE obj, VALUE fname)
static VALUE rb_file_writable_real_p (VALUE obj, VALUE fname)
static VALUE rb_file_world_writable_p (VALUE obj, VALUE fname)
static VALUE rb_file_executable_p (VALUE obj, VALUE fname)
static VALUE rb_file_executable_real_p (VALUE obj, VALUE fname)
static VALUE rb_file_file_p (VALUE obj, VALUE fname)
static VALUE rb_file_zero_p (VALUE obj, VALUE fname)
static VALUE rb_file_size_p (VALUE obj, VALUE fname)
static VALUE rb_file_owned_p (VALUE obj, VALUE fname)
static VALUE rb_file_rowned_p (VALUE obj, VALUE fname)
static VALUE rb_file_grpowned_p (VALUE obj, VALUE fname)
static VALUE rb_file_suid_p (VALUE obj, VALUE fname)
static VALUE rb_file_sgid_p (VALUE obj, VALUE fname)
static VALUE rb_file_sticky_p (VALUE obj, VALUE fname)
static VALUE rb_file_identical_p (VALUE obj, VALUE fname1, VALUE fname2)
static VALUE rb_file_s_size (VALUE klass, VALUE fname)
static VALUE rb_file_ftype (const struct stat *st)
static VALUE rb_file_s_ftype (VALUE klass, VALUE fname)
static VALUE rb_file_s_atime (VALUE klass, VALUE fname)
static VALUE rb_file_atime (VALUE obj)
static VALUE rb_file_s_mtime (VALUE klass, VALUE fname)
static VALUE rb_file_mtime (VALUE obj)
static VALUE rb_file_s_ctime (VALUE klass, VALUE fname)
static VALUE rb_file_ctime (VALUE obj)
static VALUE rb_file_size (VALUE obj)
static void chmod_internal (const char *path, VALUE pathv, void *mode)
static VALUE rb_file_s_chmod (int argc, VALUE *argv)
static VALUE rb_file_chmod (VALUE obj, VALUE vmode)
static void chown_internal (const char *path, VALUE pathv, void *arg)
static VALUE rb_file_s_chown (int argc, VALUE *argv)
static VALUE rb_file_chown (VALUE obj, VALUE owner, VALUE group)
static void utime_internal (const char *path, VALUE pathv, void *arg)
static VALUE rb_file_s_utime (int argc, VALUE *argv)
 NORETURN (static void sys_fail2(VALUE, VALUE))
static void sys_fail2 (VALUE s1, VALUE s2)
static void unlink_internal (const char *path, VALUE pathv, void *arg)
static VALUE rb_file_s_unlink (VALUE klass, VALUE args)
static VALUE rb_file_s_rename (VALUE klass, VALUE from, VALUE to)
static VALUE rb_file_s_umask (int argc, VALUE *argv)
static char * skiproot (const char *path)
char * rb_path_next (const char *s)
char * rb_path_skip_prefix (const char *path)
static char * skipprefixroot (const char *path)
char * rb_path_last_separator (const char *path)
static char * chompdirsep (const char *path)
char * rb_path_end (const char *path)
static char * ntfs_tail (const char *path)
VALUE rb_home_dir (const char *user, VALUE result)
static VALUE file_expand_path (VALUE fname, VALUE dname, int abs_mode, VALUE result)
static VALUE file_expand_path_1 (VALUE fname)
VALUE rb_file_expand_path (VALUE fname, VALUE dname)
VALUE rb_file_s_expand_path (int argc, VALUE *argv)
VALUE rb_file_absolute_path (VALUE fname, VALUE dname)
VALUE rb_file_s_absolute_path (int argc, VALUE *argv)
static void realpath_rec (long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopcheck, int strict, int last)
VALUE rb_realpath_internal (VALUE basedir, VALUE path, int strict)
static VALUE rb_file_s_realpath (int argc, VALUE *argv, VALUE klass)
static VALUE rb_file_s_realdirpath (int argc, VALUE *argv, VALUE klass)
static size_t rmext (const char *p, long l0, long l1, const char *e)
const char * ruby_find_basename (const char *name, long *baselen, long *alllen)
static VALUE rb_file_s_basename (int argc, VALUE *argv)
static VALUE rb_file_s_dirname (VALUE klass, VALUE fname)
VALUE rb_file_dirname (VALUE fname)
const char * ruby_find_extname (const char *name, long *len)
static VALUE rb_file_s_extname (VALUE klass, VALUE fname)
static VALUE rb_file_s_path (VALUE klass, VALUE fname)
static VALUE rb_file_s_split (VALUE klass, VALUE path)
static VALUE rb_file_join (VALUE ary, VALUE sep)
static VALUE file_inspect_join (VALUE ary, VALUE argp, int recur)
static VALUE rb_file_s_join (VALUE klass, VALUE args)
static VALUE rb_thread_flock (void *data)
static VALUE rb_file_flock (VALUE obj, VALUE operation)
static void test_check (int n, int argc, VALUE *argv)
static VALUE rb_f_test (int argc, VALUE *argv)
static VALUE rb_stat_s_alloc (VALUE klass)
static VALUE rb_stat_init (VALUE obj, VALUE fname)
static VALUE rb_stat_init_copy (VALUE copy, VALUE orig)
static VALUE rb_stat_ftype (VALUE obj)
static VALUE rb_stat_d (VALUE obj)
static VALUE rb_stat_p (VALUE obj)
static VALUE rb_stat_l (VALUE obj)
static VALUE rb_stat_S (VALUE obj)
static VALUE rb_stat_b (VALUE obj)
static VALUE rb_stat_c (VALUE obj)
static VALUE rb_stat_owned (VALUE obj)
static VALUE rb_stat_rowned (VALUE obj)
static VALUE rb_stat_grpowned (VALUE obj)
static VALUE rb_stat_r (VALUE obj)
static VALUE rb_stat_R (VALUE obj)
static VALUE rb_stat_wr (VALUE obj)
static VALUE rb_stat_w (VALUE obj)
static VALUE rb_stat_W (VALUE obj)
static VALUE rb_stat_ww (VALUE obj)
static VALUE rb_stat_x (VALUE obj)
static VALUE rb_stat_X (VALUE obj)
static VALUE rb_stat_f (VALUE obj)
static VALUE rb_stat_z (VALUE obj)
static VALUE rb_stat_s (VALUE obj)
static VALUE rb_stat_suid (VALUE obj)
static VALUE rb_stat_sgid (VALUE obj)
static VALUE rb_stat_sticky (VALUE obj)
void rb_file_const (const char *name, VALUE value)
int rb_is_absolute_path (const char *path)
static int path_check_0 (VALUE path, int execpath)
int rb_path_check (const char *path)
static int file_load_ok (const char *path)
int rb_file_load_ok (const char *path)
static int is_explicit_relative (const char *path)
static VALUE copy_path_class (VALUE path, VALUE orig)
int rb_find_file_ext (VALUE *filep, const char *const *ext)
int rb_find_file_ext_safe (VALUE *filep, const char *const *ext, int safe_level)
VALUE rb_find_file (VALUE path)
VALUE rb_find_file_safe (VALUE path, int safe_level)
static void define_filetest_function (const char *name, VALUE(*func)(ANYARGS), int argc)
void Init_File (void)

Variables

VALUE rb_cFile
VALUE rb_mFileTest
VALUE rb_cStat
static const rb_data_type_t stat_data_type
static VALUE separator
VALUE rb_mFConst
static const char null_device []

Define Documentation

#define access ( p,
 )     rb_w32_uaccess((p), (m))

Definition at line 80 of file file.c.

Referenced by access_internal(), eaccess(), path_check_0(), rb_file_identical_p(), and rb_w32_wopen().

#define BUFCHECK ( cond   ) 
Value:
do {\
    bdiff = p - buf;\
    if (cond) {\
        do {buflen *= 2;} while (cond);\
        rb_str_resize(result, buflen);\
        buf = RSTRING_PTR(result);\
        p = buf + bdiff;\
        pend = buf + buflen;\
    }\
} while (0)

Definition at line 2795 of file file.c.

Referenced by file_expand_path().

 
#define BUFINIT (  ) 
Value:
(\
    p = buf = RSTRING_PTR(result),\
    buflen = RSTRING_LEN(result),\
    pend = p + buflen)

Definition at line 2806 of file file.c.

Referenced by file_expand_path().

#define CHECK (  )     test_check((n), argc, argv)

Definition at line 4104 of file file.c.

Referenced by rb_f_test(), rb_str_format(), and ruby__sfvwrite().

#define check_expand_path_args ( fname,
dname   ) 
Value:
(((fname) = rb_get_path(fname)), \
     (void)(NIL_P(dname) ? (dname) : ((dname) = rb_get_path(dname))))

Definition at line 3174 of file file.c.

Referenced by rb_file_absolute_path(), and rb_file_expand_path().

#define chmod ( p,
 )     rb_w32_uchmod((p), (m))
#define chown ( p,
o,
 )     rb_w32_uchown((p), (o), (g))

Definition at line 84 of file file.c.

Referenced by argf_next_argv(), chown_internal(), get_device_once(), and rb_file_chown().

#define DEVT2NUM (  )     UINT2NUM(v)

Definition at line 328 of file file.c.

Referenced by rb_stat_dev(), rb_stat_rdev(), rb_stat_rdev_major(), and rb_stat_rdev_minor().

#define ENABLE_PATH_CHECK   1

Definition at line 4970 of file file.c.

 
#define EXPAND_PATH_BUFFER (  )     rb_usascii_str_new(0, MAXPATHLEN + 2)

Definition at line 3172 of file file.c.

Referenced by file_expand_path_1(), rb_file_absolute_path(), and rb_file_expand_path().

#define fncomp   strncmp

Referenced by rmext().

#define fpath_check ( path   )     path_check_0((path), FALSE)

Definition at line 5020 of file file.c.

Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().

#define has_unc ( buf   )     0

Definition at line 2614 of file file.c.

#define insecure_obj_p ( obj,
level   )     ((level) >= 4 || ((level) > 0 && OBJ_TAINTED(obj)))

Definition at line 130 of file file.c.

Referenced by rb_get_path_check().

#define isdirsep (  )     ((x) == '/')

Definition at line 2590 of file file.c.

#define istrailinggarbage (  )     ((x) == '.' || (x) == ' ')

Definition at line 2602 of file file.c.

Referenced by file_expand_path(), ntfs_tail(), and ruby_find_extname().

#define link ( f,
 )     rb_w32_ulink((f), (t))

Definition at line 88 of file file.c.

Referenced by r_object0(), rb_exec_end_proc(), rb_mark_end_proc(), rb_set_end_proc(), and realpath_rec().

#define LOCK_EX   2

Definition at line 3969 of file file.c.

Referenced by flock_winnt(), and Init_File().

#define LOCK_NB   4

Definition at line 3972 of file file.c.

Referenced by flock_winnt(), Init_File(), and rb_file_flock().

#define LOCK_SH   1

Definition at line 3966 of file file.c.

Referenced by flock_winnt(), and Init_File().

#define LOCK_UN   8

Definition at line 3975 of file file.c.

Referenced by flock_winnt(), and Init_File().

#define lstat ( p,
 )     rb_w32_ustati64((p), (s))

Definition at line 78 of file file.c.

#define nextdirsep   rb_path_next

Definition at line 2680 of file file.c.

Referenced by file_expand_path(), and rb_path_skip_prefix().

#define NUM2DEVT (  )     NUM2UINT(v)

Definition at line 325 of file file.c.

Referenced by rb_stat_inspect().

#define PRI_DEVT_PREFIX   ""

Definition at line 331 of file file.c.

Referenced by rb_stat_inspect().

#define rb_file_s_lchmod   rb_f_notimplement

Definition at line 2063 of file file.c.

Referenced by Init_File().

#define rb_file_s_lchown   rb_f_notimplement

Definition at line 2207 of file file.c.

Referenced by Init_File().

#define rb_file_s_link   rb_f_notimplement

Definition at line 2393 of file file.c.

Referenced by Init_File().

#define rb_file_s_readlink   rb_f_notimplement

Definition at line 2469 of file file.c.

Referenced by Init_File(), and realpath_rec().

#define rb_file_s_symlink   rb_f_notimplement

Definition at line 2424 of file file.c.

Referenced by Init_File().

#define rb_file_s_truncate   rb_f_notimplement

Definition at line 3921 of file file.c.

Referenced by Init_File().

#define rb_file_truncate   rb_f_notimplement

Definition at line 3962 of file file.c.

Referenced by Init_File().

#define rb_sys_fail_path ( path   )     rb_sys_fail_str(path)

Definition at line 97 of file file.c.

#define rename ( f,
 )     rb_w32_urename((f), (t))

Definition at line 92 of file file.c.

Referenced by argf_next_argv(), main(), and rb_file_s_rename().

#define S_IRUGO   (S_IRUSR | S_IRGRP | S_IROTH)
#define S_ISBLK (  )     (0)
#define S_ISCHR (  )     (((m) & S_IFMT) == S_IFCHR)
#define S_ISREG (  )     (((m) & S_IFMT) == S_IFREG)

Definition at line 1457 of file file.c.

Referenced by file_load_ok(), rb_file_file_p(), rb_file_ftype(), rb_stat_f(), remain_size(), and wsplit_p().

#define S_IWOTH   002
#define S_IWUGO   (S_IWUSR | S_IWGRP | S_IWOTH)
#define S_IXUGO   (S_IXUSR | S_IXGRP | S_IXOTH)
#define skipprefix ( path   )     (path)

Definition at line 2693 of file file.c.

Referenced by file_expand_path(), rb_file_dirname(), ruby_find_basename(), and skipprefixroot().

#define ST2UINT ( val   )     ((val) & ~(~1UL << (sizeof(val) * CHAR_BIT - 1)))

Definition at line 322 of file file.c.

Referenced by rb_stat_mode().

#define STAT ( p,
 )     rb_w32_ustati64((p), (s))

Definition at line 76 of file file.c.

Referenced by eaccess(), path_check_0(), rb_stat(), and rb_stat_init().

#define strrdirsep   rb_path_last_separator
#define unlink (  )     rb_w32_uunlink(p)

Definition at line 90 of file file.c.

Referenced by argf_next_argv(), main(), rb_file_s_rename(), unlink_internal(), and valid_filename().

#define USE_NTFS   1

Definition at line 2595 of file file.c.

#define utime ( p,
 )     rb_w32_uutime((p), (t))

Definition at line 86 of file file.c.

Referenced by main(), and utime_internal().

#define utime_failed ( path,
tsp,
atime,
mtime   )     rb_sys_fail_path(path)

Definition at line 2250 of file file.c.

Referenced by utime_internal().


Function Documentation

static int access_internal ( const char *  path,
int  mode 
) [inline, static]

Definition at line 1068 of file file.c.

References access.

Referenced by rb_file_executable_real_p(), rb_file_readable_real_p(), and rb_file_writable_real_p().

static long apply2files ( void(*)(const char *, VALUE, void *)  func,
VALUE  vargs,
void *  arg 
) [static]
static void chmod_internal ( const char *  path,
VALUE  pathv,
void *  mode 
) [static]

Definition at line 1956 of file file.c.

References chmod, and rb_sys_fail_path.

Referenced by rb_file_s_chmod().

static char* chompdirsep ( const char *  path  )  [static]

Definition at line 2748 of file file.c.

References CharNext, isdirsep, and last.

Referenced by file_expand_path(), rb_file_join(), rb_path_end(), rb_realpath_internal(), and ruby_find_basename().

static void chown_internal ( const char *  path,
VALUE  pathv,
void *  arg 
) [static]

Definition at line 2072 of file file.c.

References args, chown, chown_args::group, chown_args::owner, and rb_sys_fail_path.

Referenced by rb_file_s_chown().

static VALUE copy_path_class ( VALUE  path,
VALUE  orig 
) [static]

Definition at line 5086 of file file.c.

References OBJ_FREEZE, rb_obj_class(), and RBASIC.

Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().

static void define_filetest_function ( const char *  name,
VALUE(*)(ANYARGS)  func,
int  argc 
) [static]

Definition at line 5233 of file file.c.

References func, rb_define_module_function(), and rb_define_singleton_method().

Referenced by Init_File().

int eaccess ( const char *  path,
int  mode 
)
static VALUE file_expand_path ( VALUE  fname,
VALUE  dname,
int  abs_mode,
VALUE  result 
) [static]
static VALUE file_expand_path_1 ( VALUE  fname  )  [static]

Definition at line 3179 of file file.c.

References EXPAND_PATH_BUFFER, file_expand_path(), and Qnil.

Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().

static VALUE file_inspect_join ( VALUE  ary,
VALUE  argp,
int  recur 
) [static]

Definition at line 3788 of file file.c.

References rb_eArgError, rb_file_join(), and rb_raise().

Referenced by rb_file_join().

static int file_load_ok ( const char *  path  )  [static]

Definition at line 5053 of file file.c.

References fstat, open, rb_update_max_fd(), S_ISREG, and stat.

Referenced by rb_file_load_ok(), rb_find_file_ext_safe(), and rb_find_file_safe().

static VALUE file_path_convert ( VALUE  name  )  [static]
int flock ( int  ,
int   
)

Definition at line 371 of file win32.c.

Referenced by rb_thread_flock().

static struct stat* get_stat ( VALUE  self  )  [static, read]
void Init_File ( void   ) 

Definition at line 5284 of file file.c.

References define_filetest_function(), INT2FIX, LOCK_EX, LOCK_NB, LOCK_SH, LOCK_UN, PATH_SEP, Qnil, rb_cIO, rb_cObject, rb_define_alloc_func(), rb_define_class(), rb_define_class_under(), rb_define_const(), rb_define_global_function(), rb_define_method(), rb_define_module(), rb_define_module_under(), rb_define_singleton_method(), rb_f_test(), rb_file_atime(), rb_file_blockdev_p(), rb_file_chardev_p(), rb_file_chmod(), rb_file_chown(), rb_file_const(), rb_file_ctime(), rb_file_directory_p(), rb_file_executable_p(), rb_file_executable_real_p(), rb_file_exist_p(), rb_file_file_p(), rb_file_flock(), rb_file_grpowned_p(), rb_file_identical_p(), rb_file_lstat(), rb_file_mtime(), rb_file_owned_p(), rb_file_path(), rb_file_pipe_p(), rb_file_readable_p(), rb_file_readable_real_p(), rb_file_s_absolute_path(), rb_file_s_atime(), rb_file_s_basename(), rb_file_s_chmod(), rb_file_s_chown(), rb_file_s_ctime(), rb_file_s_dirname(), rb_file_s_expand_path(), rb_file_s_extname(), rb_file_s_ftype(), rb_file_s_join(), rb_file_s_lchmod, rb_file_s_lchown, rb_file_s_link, rb_file_s_lstat(), rb_file_s_mtime(), rb_file_s_path(), rb_file_s_readlink, rb_file_s_realdirpath(), rb_file_s_realpath(), rb_file_s_rename(), rb_file_s_size(), rb_file_s_split(), rb_file_s_stat(), rb_file_s_symlink, rb_file_s_truncate, rb_file_s_umask(), rb_file_s_unlink(), rb_file_s_utime(), rb_file_sgid_p(), rb_file_size(), rb_file_size_p(), rb_file_socket_p(), rb_file_sticky_p(), rb_file_suid_p(), rb_file_symlink_p(), rb_file_truncate, rb_file_world_readable_p(), rb_file_world_writable_p(), rb_file_writable_p(), rb_file_writable_real_p(), rb_file_zero_p(), rb_include_module(), rb_io_stat(), rb_mComparable, rb_obj_freeze(), rb_stat_atime(), rb_stat_b(), rb_stat_blksize(), rb_stat_blocks(), rb_stat_c(), rb_stat_cmp(), rb_stat_ctime(), rb_stat_d(), rb_stat_dev(), rb_stat_dev_major(), rb_stat_dev_minor(), rb_stat_f(), rb_stat_ftype(), rb_stat_gid(), rb_stat_grpowned(), rb_stat_init(), rb_stat_init_copy(), rb_stat_ino(), rb_stat_inspect(), rb_stat_l(), rb_stat_mode(), rb_stat_mtime(), rb_stat_nlink(), rb_stat_owned(), rb_stat_p(), rb_stat_R(), rb_stat_r(), rb_stat_rdev(), rb_stat_rdev_major(), rb_stat_rdev_minor(), rb_stat_S(), rb_stat_s(), rb_stat_s_alloc(), rb_stat_sgid(), rb_stat_size(), rb_stat_sticky(), rb_stat_suid(), rb_stat_uid(), rb_stat_W(), rb_stat_w(), rb_stat_wr(), rb_stat_ww(), rb_stat_X(), rb_stat_x(), rb_stat_z(), rb_str_new2, and rb_usascii_str_new2.

Referenced by Init_IO().

static int is_explicit_relative ( const char *  path  )  [static]

Definition at line 5078 of file file.c.

References isdirsep.

Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().

NORETURN ( static void   sys_fail2VALUE, VALUE  ) 
static char* ntfs_tail ( const char *  path  )  [static]

Definition at line 2772 of file file.c.

References CharNext, isdirsep, istrailinggarbage, and last.

Referenced by ruby_find_basename().

static int path_check_0 ( VALUE  path,
int  execpath 
) [static]
static VALUE rb_f_test ( int  argc,
VALUE argv 
) [static]
VALUE rb_file_absolute_path ( VALUE  fname,
VALUE  dname 
)
static VALUE rb_file_atime ( VALUE  obj  )  [static]

Definition at line 1820 of file file.c.

References rb_io_t::fd, fstat, GetOpenFile, rb_io_t::pathv, rb_sys_fail_path, stat, and stat_atime().

Referenced by Init_File().

static VALUE rb_file_blockdev_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1226 of file file.c.

References Qfalse, Qtrue, rb_stat(), S_ISBLK, and stat.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_chardev_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1253 of file file.c.

References Qfalse, Qtrue, rb_stat(), S_ISCHR, and stat.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_chmod ( VALUE  obj,
VALUE  vmode 
) [static]
static VALUE rb_file_chown ( VALUE  obj,
VALUE  owner,
VALUE  group 
) [static]
void rb_file_const ( const char *  name,
VALUE  value 
)

Definition at line 4946 of file file.c.

References rb_define_const().

Referenced by Init_Dir(), Init_File(), and Init_IO().

static VALUE rb_file_ctime ( VALUE  obj  )  [static]

Definition at line 1917 of file file.c.

References rb_io_t::fd, fstat, GetOpenFile, rb_io_t::pathv, rb_sys_fail_path, stat, and stat_ctime().

Referenced by Init_File().

VALUE rb_file_directory_p ( VALUE  obj,
VALUE  fname 
)

Definition at line 1110 of file file.c.

References Qfalse, Qtrue, rb_stat(), S_ISDIR, and stat.

Referenced by Init_Dir(), Init_File(), and rb_f_test().

VALUE rb_file_dirname ( VALUE  fname  ) 
static VALUE rb_file_executable_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1429 of file file.c.

References eaccess(), FilePathValue, Qfalse, Qtrue, rb_secure(), rb_str_encode_ospath(), StringValueCStr, and X_OK.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_executable_real_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1447 of file file.c.

References access_internal(), FilePathValue, Qfalse, Qtrue, rb_secure(), rb_str_encode_ospath(), StringValueCStr, and X_OK.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_exist_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1276 of file file.c.

References Qfalse, Qtrue, rb_stat(), and stat.

Referenced by Init_File(), and rb_f_test().

VALUE rb_file_expand_path ( VALUE  fname,
VALUE  dname 
)
static VALUE rb_file_file_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1469 of file file.c.

References Qfalse, Qtrue, rb_stat(), S_ISREG, and stat.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_flock ( VALUE  obj,
VALUE  operation 
) [static]
static VALUE rb_file_ftype ( const struct stat *  st  )  [static]

Definition at line 1716 of file file.c.

References rb_usascii_str_new2, S_ISBLK, S_ISCHR, S_ISDIR, S_ISLNK, and S_ISREG.

Referenced by rb_file_s_ftype(), and rb_stat_ftype().

static VALUE rb_file_grpowned_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1553 of file file.c.

References Qfalse, Qtrue, rb_group_member(), rb_stat(), and stat.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_identical_p ( VALUE  obj,
VALUE  fname1,
VALUE  fname2 
) [static]
static VALUE rb_file_join ( VALUE  ary,
VALUE  sep 
) [static]
int rb_file_load_ok ( const char *  path  ) 

Definition at line 5072 of file file.c.

References file_load_ok().

Referenced by rb_f_load().

static VALUE rb_file_lstat ( VALUE  obj  )  [static]
static VALUE rb_file_mtime ( VALUE  obj  )  [static]

Definition at line 1865 of file file.c.

References rb_io_t::fd, fstat, GetOpenFile, rb_io_t::pathv, rb_sys_fail_path, stat, and stat_mtime().

Referenced by Init_File().

static VALUE rb_file_owned_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1524 of file file.c.

References geteuid(), Qfalse, Qtrue, rb_stat(), and stat.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_path ( VALUE  obj  )  [static]
static VALUE rb_file_pipe_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1131 of file file.c.

References Qfalse, Qtrue, rb_stat(), and stat.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_readable_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1293 of file file.c.

References eaccess(), FilePathValue, Qfalse, Qtrue, R_OK, rb_secure(), rb_str_encode_ospath(), and StringValueCStr.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_readable_real_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1311 of file file.c.

References access_internal(), FilePathValue, Qfalse, Qtrue, R_OK, rb_secure(), rb_str_encode_ospath(), and StringValueCStr.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_rowned_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1534 of file file.c.

References getuid(), Qfalse, Qtrue, rb_stat(), and stat.

Referenced by rb_f_test().

VALUE rb_file_s_absolute_path ( int  argc,
VALUE argv 
)

Definition at line 3242 of file file.c.

References Qnil, rb_file_absolute_path(), and rb_scan_args().

Referenced by Init_File().

static VALUE rb_file_s_atime ( VALUE  klass,
VALUE  fname 
) [static]

Definition at line 1797 of file file.c.

References FilePathValue, rb_stat(), rb_sys_fail_path, stat, and stat_atime().

Referenced by Init_File().

static VALUE rb_file_s_basename ( int  argc,
VALUE argv 
) [static]
static VALUE rb_file_s_chmod ( int  argc,
VALUE argv 
) [static]

Definition at line 1976 of file file.c.

References apply2files(), chmod_internal(), LONG2FIX, NUM2INT, rb_scan_args(), and rb_secure().

Referenced by Init_File().

static VALUE rb_file_s_chown ( int  argc,
VALUE argv 
) [static]
static VALUE rb_file_s_ctime ( VALUE  klass,
VALUE  fname 
) [static]

Definition at line 1892 of file file.c.

References FilePathValue, rb_stat(), rb_sys_fail_path, stat, and stat_ctime().

Referenced by Init_File().

static VALUE rb_file_s_dirname ( VALUE  klass,
VALUE  fname 
) [static]

Definition at line 3606 of file file.c.

References rb_file_dirname().

Referenced by Init_File(), and rb_file_s_split().

VALUE rb_file_s_expand_path ( int  argc,
VALUE argv 
)

Definition at line 3209 of file file.c.

References Qnil, rb_file_expand_path(), and rb_scan_args().

Referenced by Init_File().

static VALUE rb_file_s_extname ( VALUE  klass,
VALUE  fname 
) [static]

Definition at line 3731 of file file.c.

References FilePathStringValue, len, name, OBJ_INFECT, rb_enc_copy(), rb_str_new(), ruby_find_extname(), and StringValueCStr.

Referenced by Init_File().

static VALUE rb_file_s_ftype ( VALUE  klass,
VALUE  fname 
) [static]
static VALUE rb_file_s_join ( VALUE  klass,
VALUE  args 
) [static]

Definition at line 3870 of file file.c.

References rb_file_join().

Referenced by Init_File().

static VALUE rb_file_s_lstat ( VALUE  klass,
VALUE  fname 
) [static]
static VALUE rb_file_s_mtime ( VALUE  klass,
VALUE  fname 
) [static]

Definition at line 1843 of file file.c.

References FilePathValue, rb_stat(), rb_sys_fail_path, stat, and stat_mtime().

Referenced by Init_File().

static VALUE rb_file_s_path ( VALUE  klass,
VALUE  fname 
) [static]

Definition at line 3760 of file file.c.

References rb_get_path().

Referenced by Init_File().

static VALUE rb_file_s_realdirpath ( int  argc,
VALUE argv,
VALUE  klass 
) [static]

Definition at line 3447 of file file.c.

References rb_realpath_internal(), and rb_scan_args().

Referenced by Init_File().

static VALUE rb_file_s_realpath ( int  argc,
VALUE argv,
VALUE  klass 
) [static]

Definition at line 3427 of file file.c.

References rb_realpath_internal(), and rb_scan_args().

Referenced by Init_File().

static VALUE rb_file_s_rename ( VALUE  klass,
VALUE  from,
VALUE  to 
) [static]

Definition at line 2510 of file file.c.

References chmod, FilePathValue, INT2FIX, rb_secure(), rb_str_encode_ospath(), rename, StringValueCStr, sys_fail2(), and unlink.

Referenced by Init_File().

static VALUE rb_file_s_size ( VALUE  klass,
VALUE  fname 
) [static]

Definition at line 1704 of file file.c.

References FilePathValue, OFFT2NUM, rb_stat(), rb_sys_fail_path, and stat.

Referenced by Init_File().

static VALUE rb_file_s_split ( VALUE  klass,
VALUE  path 
) [static]

Definition at line 3777 of file file.c.

References FilePathStringValue, Qnil, rb_assoc_new(), rb_file_s_basename(), and rb_file_s_dirname().

Referenced by Init_File().

static VALUE rb_file_s_stat ( VALUE  klass,
VALUE  fname 
) [static]

Definition at line 877 of file file.c.

References FilePathValue, rb_secure(), rb_stat(), rb_sys_fail_path, stat, and stat_new().

Referenced by Init_File(), and rb_file_s_lstat().

static VALUE rb_file_s_umask ( int  argc,
VALUE argv 
) [static]

Definition at line 2560 of file file.c.

References INT2FIX, NUM2INT, rb_eArgError, rb_raise(), and rb_secure().

Referenced by Init_File().

static VALUE rb_file_s_unlink ( VALUE  klass,
VALUE  args 
) [static]

Definition at line 2490 of file file.c.

References apply2files(), LONG2FIX, rb_secure(), and unlink_internal().

Referenced by Init_File().

static VALUE rb_file_s_utime ( int  argc,
VALUE argv 
) [static]
static VALUE rb_file_sgid_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1604 of file file.c.

References Qfalse.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_size ( VALUE  obj  )  [static]
static VALUE rb_file_size_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1505 of file file.c.

References OFFT2NUM, Qnil, rb_stat(), and stat.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_socket_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1192 of file file.c.

References Qfalse, Qtrue, rb_stat(), and stat.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_sticky_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1621 of file file.c.

References Qnil.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_suid_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1587 of file file.c.

References Qfalse.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_symlink_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1155 of file file.c.

References FilePathValue, lstat, Qfalse, Qtrue, rb_secure(), rb_str_encode_ospath(), S_ISLNK, stat, and StringValueCStr.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_world_readable_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1343 of file file.c.

References Qnil, rb_stat(), S_IROTH, S_IRUGO, S_IWUGO, S_IXUGO, stat, and UINT2NUM().

Referenced by Init_File().

static VALUE rb_file_world_writable_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1407 of file file.c.

References Qnil, rb_stat(), S_IRUGO, S_IWOTH, S_IWUGO, S_IXUGO, stat, and UINT2NUM().

Referenced by Init_File().

static VALUE rb_file_writable_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1365 of file file.c.

References eaccess(), FilePathValue, Qfalse, Qtrue, rb_secure(), rb_str_encode_ospath(), StringValueCStr, and W_OK.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_writable_real_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1383 of file file.c.

References access_internal(), FilePathValue, Qfalse, Qtrue, rb_secure(), rb_str_encode_ospath(), StringValueCStr, and W_OK.

Referenced by Init_File(), and rb_f_test().

static VALUE rb_file_zero_p ( VALUE  obj,
VALUE  fname 
) [static]

Definition at line 1487 of file file.c.

References Qfalse, Qtrue, rb_stat(), and stat.

Referenced by Init_File(), and rb_f_test().

VALUE rb_find_file ( VALUE  path  ) 

Definition at line 5168 of file file.c.

References rb_find_file_safe(), and rb_safe_level.

Referenced by rb_f_load(), and rb_load().

int rb_find_file_ext ( VALUE filep,
const char *const *  ext 
)

Definition at line 5094 of file file.c.

References rb_find_file_ext_safe(), and rb_safe_level.

int rb_find_file_ext_safe ( VALUE filep,
const char *const *  ext,
int  safe_level 
)
VALUE rb_find_file_safe ( VALUE  path,
int  safe_level 
)
VALUE rb_get_path ( VALUE  obj  ) 

Definition at line 187 of file file.c.

References rb_get_path_check(), and rb_safe_level.

Referenced by apply2files(), and rb_file_s_path().

static VALUE rb_get_path_check ( VALUE  obj,
int  level 
) [static]
VALUE rb_get_path_no_checksafe ( VALUE  obj  ) 

Definition at line 181 of file file.c.

References rb_get_path_check().

static int rb_group_member ( GETGROUPS_T  gid  )  [static]

Definition at line 985 of file file.c.

References FALSE, getegid(), getgid(), TRUE, xfree, and xmalloc.

Referenced by eaccess(), rb_file_grpowned_p(), rb_stat_grpowned(), rb_stat_R(), rb_stat_W(), and rb_stat_X().

VALUE rb_home_dir ( const char *  user,
VALUE  result 
)
static VALUE rb_io_stat ( VALUE  obj  )  [static]

Definition at line 905 of file file.c.

References rb_io_t::fd, fstat, GetOpenFile, rb_io_t::pathv, rb_sys_fail_path, stat, and stat_new().

Referenced by Init_File(), and rb_file_lstat().

int rb_is_absolute_path ( const char *  path  ) 

Definition at line 4952 of file file.c.

References isdirsep.

Referenced by file_expand_path(), path_check_0(), rb_find_file_ext_safe(), and rb_find_file_safe().

int rb_path_check ( const char *  path  ) 

Definition at line 5026 of file file.c.

References path_check_0(), PATH_SEP_CHAR, rb_str_new(), strchr(), strlen(), and TRUE.

Referenced by path_tainted_p().

char* rb_path_end ( const char *  path  ) 

Definition at line 2764 of file file.c.

References chompdirsep(), and isdirsep.

Referenced by check_dirname().

char* rb_path_last_separator ( const char *  path  ) 

Definition at line 2730 of file file.c.

References CharNext, isdirsep, last, and NULL.

Referenced by realpath_rec().

char* rb_path_next ( const char *  s  ) 

Definition at line 2682 of file file.c.

References CharNext, and isdirsep.

Referenced by realpath_rec().

char* rb_path_skip_prefix ( const char *  path  ) 

Definition at line 2696 of file file.c.

References isdirsep, and nextdirsep.

Referenced by check_dirname(), and ruby_glob0().

VALUE rb_realpath_internal ( VALUE  basedir,
VALUE  path,
int  strict 
)
static int rb_stat ( VALUE  file,
struct stat *  st 
) [static]
static VALUE rb_stat_atime ( VALUE  self  )  [static]

Definition at line 690 of file file.c.

References get_stat(), and stat_atime().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_b ( VALUE  obj  )  [static]

Definition at line 4497 of file file.c.

References get_stat(), Qfalse, Qtrue, and S_ISBLK.

Referenced by Init_File().

static VALUE rb_stat_blksize ( VALUE  self  )  [static]

Definition at line 572 of file file.c.

References get_stat(), Qnil, and ULONG2NUM().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_blocks ( VALUE  self  )  [static]

Definition at line 593 of file file.c.

References get_stat(), Qnil, and ULONG2NUM().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_c ( VALUE  obj  )  [static]

Definition at line 4519 of file file.c.

References get_stat(), Qfalse, Qtrue, and S_ISCHR.

Referenced by Init_File().

static VALUE rb_stat_cmp ( VALUE  self,
VALUE  other 
) [static]
static VALUE rb_stat_ctime ( VALUE  self  )  [static]

Definition at line 726 of file file.c.

References get_stat(), and stat_ctime().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_d ( VALUE  obj  )  [static]

Definition at line 4411 of file file.c.

References get_stat(), Qfalse, Qtrue, and S_ISDIR.

Referenced by Init_File().

static VALUE rb_stat_dev ( VALUE  self  )  [static]

Definition at line 345 of file file.c.

References DEVT2NUM, and get_stat().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_dev_major ( VALUE  self  )  [static]

Definition at line 362 of file file.c.

References get_stat(), INT2NUM(), major, and Qnil.

Referenced by Init_File().

static VALUE rb_stat_dev_minor ( VALUE  self  )  [static]

Definition at line 383 of file file.c.

References get_stat(), INT2NUM(), minor, and Qnil.

Referenced by Init_File().

static VALUE rb_stat_f ( VALUE  obj  )  [static]

Definition at line 4838 of file file.c.

References get_stat(), Qfalse, Qtrue, and S_ISREG.

Referenced by Init_File().

static VALUE rb_stat_ftype ( VALUE  obj  )  [static]

Definition at line 4394 of file file.c.

References get_stat(), and rb_file_ftype().

Referenced by Init_File().

static VALUE rb_stat_gid ( VALUE  self  )  [static]

Definition at line 476 of file file.c.

References get_stat(), and GIDT2NUM.

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_grpowned ( VALUE  obj  )  [static]

Definition at line 4565 of file file.c.

References get_stat(), Qfalse, Qtrue, and rb_group_member().

Referenced by Init_File(), rb_stat_r(), rb_stat_w(), and rb_stat_x().

static VALUE rb_stat_init ( VALUE  obj,
VALUE  fname 
) [static]
static VALUE rb_stat_init_copy ( VALUE  copy,
VALUE  orig 
) [static]

Definition at line 4356 of file file.c.

References ALLOC, DATA_PTR, rb_check_frozen, rb_eTypeError, rb_obj_class(), rb_obj_is_instance_of(), rb_raise(), stat, and xfree.

Referenced by Init_File().

static VALUE rb_stat_ino ( VALUE  self  )  [static]

Definition at line 403 of file file.c.

References get_stat(), and ULONG2NUM().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_inspect ( VALUE  self  )  [static]
static VALUE rb_stat_l ( VALUE  obj  )  [static]

Definition at line 4453 of file file.c.

References get_stat(), Qfalse, Qtrue, and S_ISLNK.

Referenced by Init_File().

static VALUE rb_stat_mode ( VALUE  self  )  [static]

Definition at line 426 of file file.c.

References get_stat(), ST2UINT, and UINT2NUM().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_mtime ( VALUE  self  )  [static]

Definition at line 706 of file file.c.

References get_stat(), and stat_mtime().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_nlink ( VALUE  self  )  [static]

Definition at line 444 of file file.c.

References get_stat(), and UINT2NUM().

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_owned ( VALUE  obj  )  [static]

Definition at line 4539 of file file.c.

References get_stat(), geteuid(), Qfalse, and Qtrue.

Referenced by Init_File(), rb_stat_r(), rb_stat_w(), and rb_stat_x().

static VALUE rb_stat_p ( VALUE  obj  )  [static]

Definition at line 4426 of file file.c.

References get_stat(), Qfalse, and Qtrue.

Referenced by Init_File().

static VALUE rb_stat_R ( VALUE  obj  )  [static]

Definition at line 4618 of file file.c.

References get_stat(), getuid(), Qfalse, Qtrue, rb_group_member(), rb_stat_rowned(), S_IRGRP, S_IROTH, S_IRUSR, and stat.

Referenced by Init_File().

static VALUE rb_stat_r ( VALUE  obj  )  [static]

Definition at line 4585 of file file.c.

References get_stat(), geteuid(), Qfalse, Qtrue, rb_stat_grpowned(), rb_stat_owned(), S_IRGRP, S_IROTH, S_IRUSR, and stat.

Referenced by Init_File().

static VALUE rb_stat_rdev ( VALUE  self  )  [static]

Definition at line 494 of file file.c.

References DEVT2NUM, get_stat(), and Qnil.

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_rdev_major ( VALUE  self  )  [static]

Definition at line 515 of file file.c.

References DEVT2NUM, get_stat(), major, and Qnil.

Referenced by Init_File().

static VALUE rb_stat_rdev_minor ( VALUE  self  )  [static]

Definition at line 536 of file file.c.

References DEVT2NUM, get_stat(), minor, and Qnil.

Referenced by Init_File().

static VALUE rb_stat_rowned ( VALUE  obj  )  [static]

Definition at line 4546 of file file.c.

References get_stat(), getuid(), Qfalse, and Qtrue.

Referenced by rb_stat_R(), rb_stat_W(), and rb_stat_X().

static VALUE rb_stat_s ( VALUE  obj  )  [static]

Definition at line 4873 of file file.c.

References get_stat(), off_t, OFFT2NUM, Qnil, and size.

Referenced by Init_File().

static VALUE rb_stat_S ( VALUE  obj  )  [static]

Definition at line 4474 of file file.c.

References get_stat(), Qfalse, and Qtrue.

Referenced by Init_File().

static VALUE rb_stat_s_alloc ( VALUE  klass  )  [static]

Definition at line 4318 of file file.c.

References stat_new_0().

Referenced by Init_File().

static VALUE rb_stat_sgid ( VALUE  obj  )  [static]

Definition at line 4914 of file file.c.

References get_stat(), Qfalse, and Qtrue.

Referenced by Init_File().

static VALUE rb_stat_size ( VALUE  self  )  [static]

Definition at line 555 of file file.c.

References get_stat(), and OFFT2NUM.

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_sticky ( VALUE  obj  )  [static]

Definition at line 4935 of file file.c.

References get_stat(), Qfalse, and Qtrue.

Referenced by Init_File().

static VALUE rb_stat_suid ( VALUE  obj  )  [static]

Definition at line 4893 of file file.c.

References get_stat(), Qfalse, and Qtrue.

Referenced by Init_File().

static VALUE rb_stat_uid ( VALUE  self  )  [static]

Definition at line 460 of file file.c.

References get_stat(), and UIDT2NUM.

Referenced by Init_File(), and rb_stat_inspect().

static VALUE rb_stat_W ( VALUE  obj  )  [static]

Definition at line 4710 of file file.c.

References get_stat(), getuid(), Qfalse, Qtrue, rb_group_member(), rb_stat_rowned(), S_IWGRP, S_IWOTH, S_IWUSR, and stat.

Referenced by Init_File().

static VALUE rb_stat_w ( VALUE  obj  )  [static]

Definition at line 4677 of file file.c.

References get_stat(), geteuid(), Qfalse, Qtrue, rb_stat_grpowned(), rb_stat_owned(), S_IWGRP, S_IWOTH, S_IWUSR, and stat.

Referenced by Init_File().

static VALUE rb_stat_wr ( VALUE  obj  )  [static]

Definition at line 4653 of file file.c.

References get_stat(), Qnil, S_IROTH, S_IRUGO, S_IWUGO, S_IXUGO, and UINT2NUM().

Referenced by Init_File().

static VALUE rb_stat_ww ( VALUE  obj  )  [static]

Definition at line 4745 of file file.c.

References get_stat(), Qnil, S_IRUGO, S_IWOTH, S_IWUGO, S_IXUGO, and UINT2NUM().

Referenced by Init_File().

static VALUE rb_stat_X ( VALUE  obj  )  [static]

Definition at line 4803 of file file.c.

References get_stat(), getuid(), Qfalse, Qtrue, rb_group_member(), rb_stat_rowned(), S_IXGRP, S_IXOTH, S_IXUGO, S_IXUSR, and stat.

Referenced by Init_File().

static VALUE rb_stat_x ( VALUE  obj  )  [static]

Definition at line 4771 of file file.c.

References get_stat(), geteuid(), Qfalse, Qtrue, rb_stat_grpowned(), rb_stat_owned(), S_IXGRP, S_IXOTH, S_IXUGO, S_IXUSR, and stat.

Referenced by Init_File().

static VALUE rb_stat_z ( VALUE  obj  )  [static]

Definition at line 4856 of file file.c.

References get_stat(), Qfalse, and Qtrue.

Referenced by Init_File().

VALUE rb_str_encode_ospath ( VALUE  path  ) 
static VALUE rb_thread_flock ( void *  data  )  [static]

Definition at line 3984 of file file.c.

References flock().

Referenced by rb_file_flock().

static void realpath_rec ( long *  prefixlenp,
VALUE resolvedp,
char *  unresolved,
VALUE  loopcheck,
int  strict,
int  last 
) [static]
static size_t rmext ( const char *  p,
long  l0,
long  l1,
const char *  e 
) [static]

Definition at line 3455 of file file.c.

References fncomp, and strlen().

Referenced by rb_file_s_basename().

const char* ruby_find_basename ( const char *  name,
long *  baselen,
long *  alllen 
)

Definition at line 3484 of file file.c.

References CharNext, chompdirsep(), isdirsep, ntfs_tail(), skipprefix, and strrdirsep.

Referenced by rb_file_s_basename(), and ruby_add_suffix().

const char* ruby_find_extname ( const char *  name,
long *  len 
)

Definition at line 3664 of file file.c.

References CharNext, isdirsep, istrailinggarbage, last, and strrdirsep.

Referenced by path_sub_ext(), rb_file_s_extname(), and ruby_add_suffix().

static char* skipprefixroot ( const char *  path  )  [inline, static]

Definition at line 2717 of file file.c.

References isdirsep, skipprefix, and skiproot().

Referenced by rb_realpath_internal(), and realpath_rec().

static char* skiproot ( const char *  path  )  [inline, static]

Definition at line 2671 of file file.c.

References isdirsep.

Referenced by file_expand_path(), rb_file_dirname(), and skipprefixroot().

static VALUE stat_atime ( struct stat *  st  )  [static]
static struct timespec stat_atimespec ( struct stat *  st  )  [static, read]

Definition at line 607 of file file.c.

References timespec::tv_nsec, and timespec::tv_sec.

Referenced by stat_atime().

static VALUE stat_ctime ( struct stat *  st  )  [static]
static struct timespec stat_ctimespec ( struct stat *  st  )  [static, read]

Definition at line 655 of file file.c.

References timespec::tv_nsec, and timespec::tv_sec.

Referenced by stat_ctime().

static size_t stat_memsize ( const void *  p  )  [static]

Definition at line 253 of file file.c.

References stat.

static VALUE stat_mtime ( struct stat *  st  )  [static]
static struct timespec stat_mtimespec ( struct stat *  st  )  [static, read]

Definition at line 631 of file file.c.

References timespec::tv_nsec, and timespec::tv_sec.

Referenced by rb_stat_cmp(), and stat_mtime().

static VALUE stat_new ( struct stat *  st  )  [static]

Definition at line 276 of file file.c.

References stat_new_0().

Referenced by rb_file_lstat(), rb_file_s_lstat(), rb_file_s_stat(), and rb_io_stat().

static VALUE stat_new_0 ( VALUE  klass,
struct stat *  st 
) [static]

Definition at line 264 of file file.c.

References ALLOC, stat, stat_data_type, and TypedData_Wrap_Struct.

Referenced by rb_stat_s_alloc(), and stat_new().

static void sys_fail2 ( VALUE  s1,
VALUE  s2 
) [static]
static void test_check ( int  n,
int  argc,
VALUE argv 
) [static]

Definition at line 4085 of file file.c.

References FilePathValue, rb_eArgError, rb_raise(), rb_secure(), T_FILE, T_STRING, and TYPE.

static void unlink_internal ( const char *  path,
VALUE  pathv,
void *  arg 
) [static]

Definition at line 2473 of file file.c.

References rb_sys_fail_path, and unlink.

Referenced by rb_file_s_unlink().

static void utime_internal ( const char *  path,
VALUE  pathv,
void *  arg 
) [static]
static HANDLE w32_io_info ( VALUE file,
BY_HANDLE_FILE_INFORMATION *  st 
) [static]

Variable Documentation

const char null_device[] [static]
Initial value:







    "/dev/null"

Definition at line 5239 of file file.c.

Definition at line 128 of file file.c.

Definition at line 4943 of file file.c.

VALUE separator [static]

Definition at line 3783 of file file.c.

Referenced by chunk_ii().

Initial value:

Definition at line 258 of file file.c.

Referenced by get_stat(), rb_stat_inspect(), and stat_new_0().


Generated on 1 Aug 2012 for Ruby by  doxygen 1.6.1