#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) stat((p), (s)) |
| #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 0 |
| #define | istrailinggarbage(x) 0 |
| #define | Next(p, e, enc) ((p) + rb_enc_mbclen((p), (e), (enc))) |
| #define | Inc(p, e, enc) ((p) = Next((p), (e), (enc))) |
| #define | has_unc(buf) 0 |
| #define | nextdirsep rb_enc_path_next |
| #define | skipprefix(path, end, enc) (path) |
| #define | strrdirsep rb_enc_path_last_separator |
| #define | BUFCHECK(cond) |
| #define | BUFINIT() |
| #define | EXPAND_PATH_BUFFER() rb_enc_str_new(0, MAXPATHLEN + 2, rb_filesystem_encoding()) |
| #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 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, const char *end, rb_encoding *enc) |
| char * | rb_enc_path_next (const char *s, const char *e, rb_encoding *enc) |
| char * | rb_enc_path_skip_prefix (const char *path, const char *end, rb_encoding *enc) |
| static char * | skipprefixroot (const char *path, const char *end, rb_encoding *enc) |
| char * | rb_enc_path_last_separator (const char *path, const char *end, rb_encoding *enc) |
| static char * | chompdirsep (const char *path, const char *end, rb_encoding *enc) |
| char * | rb_enc_path_end (const char *path, const char *end, rb_encoding *enc) |
| char * | rb_path_next (const char *path) |
| char * | rb_path_skip_prefix (const char *path) |
| char * | rb_path_last_separator (const char *path) |
| char * | rb_path_end (const char *path) |
| VALUE | rb_home_dir (const char *user, VALUE result) |
| static char * | append_fspath (VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encoding *fsenc) |
| VALUE | rb_file_expand_path_internal (VALUE fname, VALUE dname, int abs_mode, int long_name, VALUE result) |
| static VALUE | file_expand_path_1 (VALUE fname) |
| VALUE | rb_file_expand_path (VALUE fname, VALUE dname) |
| VALUE | rb_file_expand_path_fast (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, const 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, long l2, rb_encoding *enc) |
| const char * | ruby_enc_find_basename (const char *name, long *baselen, long *alllen, rb_encoding *enc) |
| 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_enc_find_extname (const char *name, long *len, rb_encoding *enc) |
| 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) |
| 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 BUFCHECK | ( | cond | ) |
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 2840 of file file.c.
Referenced by rb_file_expand_path_internal().
| #define BUFINIT | ( | ) |
(\
p = buf = RSTRING_PTR(result),\
buflen = RSTRING_LEN(result),\
pend = p + buflen)
Definition at line 2851 of file file.c.
Referenced by rb_file_expand_path_internal().
Definition at line 4253 of file file.c.
Referenced by rb_f_test(), rb_str_format(), and ruby__sfvwrite().
| #define check_expand_path_args | ( | fname, | |||
| dname | ) |
(((fname) = rb_get_path(fname)), \ (void)(NIL_P(dname) ? (dname) : ((dname) = rb_get_path(dname))))
Definition at line 3265 of file file.c.
Referenced by rb_file_absolute_path(), rb_file_expand_path(), and rb_file_expand_path_fast().
| #define DEVT2NUM | ( | v | ) | UINT2NUM(v) |
Definition at line 338 of file file.c.
Referenced by rb_stat_dev(), rb_stat_rdev(), rb_stat_rdev_major(), and rb_stat_rdev_minor().
| #define EXPAND_PATH_BUFFER | ( | ) | rb_enc_str_new(0, MAXPATHLEN + 2, rb_filesystem_encoding()) |
Definition at line 3263 of file file.c.
Referenced by file_expand_path_1(), rb_file_absolute_path(), rb_file_expand_path(), and rb_file_expand_path_fast().
| #define fncomp strncmp |
Referenced by rmext().
| #define fpath_check | ( | path | ) | path_check_0((path), FALSE) |
Definition at line 5174 of file file.c.
Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().
| #define insecure_obj_p | ( | obj, | |||
| level | ) | ((level) >= 4 || ((level) > 0 && OBJ_TAINTED(obj))) |
Definition at line 135 of file file.c.
Referenced by rb_get_path_check().
| #define istrailinggarbage | ( | x | ) | 0 |
Definition at line 2622 of file file.c.
Referenced by rb_file_expand_path_internal(), and ruby_enc_find_extname().
| #define LOCK_EX 2 |
Definition at line 4118 of file file.c.
Referenced by flock_winnt(), and Init_File().
| #define LOCK_NB 4 |
Definition at line 4121 of file file.c.
Referenced by flock_winnt(), Init_File(), and rb_file_flock().
| #define LOCK_SH 1 |
Definition at line 4115 of file file.c.
Referenced by flock_winnt(), and Init_File().
| #define LOCK_UN 8 |
Definition at line 4124 of file file.c.
Referenced by flock_winnt(), and Init_File().
| #define Next | ( | p, | |||
| e, | |||||
| enc | ) | ((p) + rb_enc_mbclen((p), (e), (enc))) |
| #define nextdirsep rb_enc_path_next |
Definition at line 2697 of file file.c.
Referenced by rb_file_expand_path_internal().
| #define NUM2DEVT | ( | v | ) | NUM2UINT(v) |
Definition at line 335 of file file.c.
Referenced by rb_stat_inspect().
| #define PRI_DEVT_PREFIX "" |
Definition at line 341 of file file.c.
Referenced by rb_stat_inspect().
| #define rb_file_s_lchmod rb_f_notimplement |
Definition at line 2073 of file file.c.
Referenced by Init_File().
| #define rb_file_s_lchown rb_f_notimplement |
Definition at line 2217 of file file.c.
Referenced by Init_File().
| #define rb_file_s_link rb_f_notimplement |
Definition at line 2403 of file file.c.
Referenced by Init_File().
| #define rb_file_s_readlink rb_f_notimplement |
Definition at line 2487 of file file.c.
Referenced by Init_File().
| #define rb_file_s_symlink rb_f_notimplement |
Definition at line 2434 of file file.c.
Referenced by Init_File().
| #define rb_file_s_truncate rb_f_notimplement |
Definition at line 4070 of file file.c.
Referenced by Init_File().
| #define rb_file_truncate rb_f_notimplement |
Definition at line 4111 of file file.c.
Referenced by Init_File().
| #define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) |
Definition at line 1331 of file file.c.
Referenced by rb_file_world_readable_p(), rb_file_world_writable_p(), rb_stat_wr(), and rb_stat_ww().
| #define S_ISBLK | ( | m | ) | (0) |
Referenced by rb_file_blockdev_p(), rb_file_ftype(), and rb_stat_b().
| #define S_ISCHR | ( | m | ) | (((m) & S_IFMT) == S_IFCHR) |
Referenced by fill_random_seed(), rb_file_chardev_p(), rb_file_ftype(), and rb_stat_c().
| #define S_ISREG | ( | m | ) | (((m) & S_IFMT) == S_IFREG) |
Definition at line 1467 of file file.c.
Referenced by rb_file_file_p(), rb_file_ftype(), rb_file_load_ok(), rb_stat_f(), remain_size(), and wsplit_p().
| #define S_IWOTH 002 |
Referenced by path_check_0(), rb_file_world_writable_p(), rb_stat_W(), rb_stat_w(), rb_stat_ww(), rb_w32_fstat(), rb_w32_fstati64(), and wstati64().
| #define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) |
Definition at line 1335 of file file.c.
Referenced by rb_file_world_readable_p(), rb_file_world_writable_p(), rb_stat_wr(), and rb_stat_ww().
| #define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) |
Definition at line 1030 of file file.c.
Referenced by eaccess(), rb_file_world_readable_p(), rb_file_world_writable_p(), rb_stat_wr(), rb_stat_ww(), rb_stat_X(), and rb_stat_x().
| #define skipprefix | ( | path, | |||
| end, | |||||
| enc | ) | (path) |
Definition at line 2710 of file file.c.
Referenced by rb_file_dirname(), rb_file_expand_path_internal(), ruby_enc_find_basename(), and skipprefixroot().
| #define ST2UINT | ( | val | ) | ((val) & ~(~1UL << (sizeof(val) * CHAR_BIT - 1))) |
Definition at line 332 of file file.c.
Referenced by rb_stat_mode().
| #define STAT | ( | p, | |||
| s | ) | stat((p), (s)) |
Definition at line 99 of file file.c.
Referenced by eaccess(), path_check_0(), rb_stat(), and rb_stat_init().
| #define strrdirsep rb_enc_path_last_separator |
Definition at line 2745 of file file.c.
Referenced by path_check_0(), rb_file_dirname(), rb_file_expand_path_internal(), realpath_rec(), ruby_enc_find_basename(), and ruby_enc_find_extname().
| #define utime_failed | ( | path, | |||
| tsp, | |||||
| atime, | |||||
| mtime | ) | rb_sys_fail_path(path) |
Definition at line 2260 of file file.c.
Referenced by utime_internal().
| static int access_internal | ( | const char * | path, | |
| int | mode | |||
| ) | [inline, static] |
Definition at line 1078 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 char* append_fspath | ( | VALUE | result, | |
| VALUE | fname, | |||
| char * | dir, | |||
| rb_encoding ** | enc, | |||
| rb_encoding * | fsenc | |||
| ) | [static] |
Definition at line 2904 of file file.c.
References NIL_P, Qnil, rb_enc_associate(), rb_str_capacity(), rb_str_resize(), RSTRING_PTR, strlen(), and xfree.
Referenced by rb_file_expand_path_internal().
| static long apply2files | ( | void(*)(const char *, VALUE, void *) | func, | |
| VALUE | vargs, | |||
| void * | arg | |||
| ) | [static] |
Definition at line 222 of file file.c.
References RARRAY_LEN, RARRAY_PTR, rb_get_path(), rb_secure(), rb_str_encode_ospath(), and RSTRING_PTR.
Referenced by rb_file_s_chmod(), rb_file_s_chown(), rb_file_s_unlink(), and rb_file_s_utime().
| static void chmod_internal | ( | const char * | path, | |
| VALUE | pathv, | |||
| void * | mode | |||
| ) | [static] |
Definition at line 1966 of file file.c.
References rb_sys_fail_path.
Referenced by rb_file_s_chmod().
| static char* chompdirsep | ( | const char * | path, | |
| const char * | end, | |||
| rb_encoding * | enc | |||
| ) | [static] |
Definition at line 2765 of file file.c.
References Inc, isdirsep, and last.
Referenced by rb_enc_path_end(), rb_file_expand_path_internal(), rb_file_join(), rb_realpath_internal(), and ruby_enc_find_basename().
| static void chown_internal | ( | const char * | path, | |
| VALUE | pathv, | |||
| void * | arg | |||
| ) | [static] |
Definition at line 2082 of file file.c.
References args, chown(), chown_args::group, chown_args::owner, and rb_sys_fail_path.
Referenced by rb_file_s_chown().
Definition at line 5236 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 5385 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 | |||
| ) |
Definition at line 1039 of file file.c.
References access, geteuid(), rb_group_member(), S_IXUGO, STAT, stat, and X_OK.
Referenced by dln_find_1(), rb_file_executable_p(), rb_file_readable_p(), and rb_file_writable_p().
Definition at line 3270 of file file.c.
References EXPAND_PATH_BUFFER, Qnil, and rb_file_expand_path_internal().
Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().
Definition at line 3935 of file file.c.
References rb_eArgError, rb_file_join(), and rb_raise().
Referenced by rb_file_join().
Definition at line 138 of file file.c.
References ENCODING_GET, NULL, rb_ascii8bit_encoding(), rb_default_internal_encoding(), rb_enc_from_index(), rb_enc_str_asciionly_p(), rb_filesystem_encoding(), rb_str_conv_enc(), and rb_usascii_encoding().
Referenced by rb_get_path_check().
| int flock | ( | int | , | |
| int | ||||
| ) |
Definition at line 124 of file flock.c.
Referenced by rb_thread_flock().
| static struct stat* get_stat | ( | VALUE | self | ) | [static, read] |
Definition at line 292 of file file.c.
References rb_eTypeError, rb_raise(), stat, stat_data_type, and TypedData_Get_Struct.
Referenced by 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_ino(), 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_rowned(), rb_stat_s(), rb_stat_S(), 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(), and rb_stat_z().
| void Init_File | ( | void | ) |
Definition at line 5436 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, rb_usascii_str_new2, and rb_w32_init_file().
Referenced by Init_IO().
| static int is_explicit_relative | ( | const char * | path | ) | [static] |
Definition at line 5228 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 int path_check_0 | ( | VALUE | path, | |
| int | execpath | |||
| ) | [static] |
Definition at line 5125 of file file.c.
References access, my_getcwd, rb_enc_get(), RB_GC_GUARD, rb_is_absolute_path(), rb_str_cat2(), rb_str_new2, rb_warn(), RSTRING_LEN, RSTRING_PTR, S_ISDIR, S_IWOTH, STAT, stat, StringValueCStr, strrdirsep, W_OK, and xfree.
Referenced by rb_path_check().
| char* rb_enc_path_end | ( | const char * | path, | |
| const char * | end, | |||
| rb_encoding * | enc | |||
| ) |
Definition at line 2781 of file file.c.
References chompdirsep(), and isdirsep.
Referenced by check_dirname(), and rb_path_end().
| char* rb_enc_path_last_separator | ( | const char * | path, | |
| const char * | end, | |||
| rb_encoding * | enc | |||
| ) |
| char* rb_enc_path_next | ( | const char * | s, | |
| const char * | e, | |||
| rb_encoding * | enc | |||
| ) |
Definition at line 2699 of file file.c.
Referenced by rb_enc_path_skip_prefix(), rb_path_next(), and realpath_rec().
| char* rb_enc_path_skip_prefix | ( | const char * | path, | |
| const char * | end, | |||
| rb_encoding * | enc | |||
| ) |
Definition at line 2713 of file file.c.
References isdirsep, and rb_enc_path_next().
Referenced by check_dirname(), rb_path_skip_prefix(), and ruby_glob0().
Definition at line 4315 of file file.c.
References CHECK, FilePathValue, ISPRINT, NUM2CHR(), Qfalse, Qnil, Qtrue, rb_eArgError, rb_file_blockdev_p(), rb_file_chardev_p(), rb_file_directory_p(), rb_file_executable_p(), rb_file_executable_real_p(), rb_file_exist_p(), rb_file_file_p(), rb_file_grpowned_p(), rb_file_identical_p(), rb_file_owned_p(), rb_file_pipe_p(), rb_file_readable_p(), rb_file_readable_real_p(), rb_file_rowned_p(), rb_file_sgid_p(), rb_file_size_p(), rb_file_socket_p(), rb_file_sticky_p(), rb_file_suid_p(), rb_file_symlink_p(), rb_file_writable_p(), rb_file_writable_real_p(), rb_file_zero_p(), rb_raise(), rb_stat(), rb_sys_fail_path, stat, stat_atime(), stat_ctime(), stat_mtime(), and strchr().
Referenced by Init_File().
Definition at line 3320 of file file.c.
References check_expand_path_args, EXPAND_PATH_BUFFER, and rb_file_expand_path_internal().
Referenced by rb_f_require_relative(), and rb_file_s_absolute_path().
Definition at line 1830 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().
Definition at line 1236 of file file.c.
References Qfalse, Qtrue, rb_stat(), S_ISBLK, and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 1263 of file file.c.
References Qfalse, Qtrue, rb_stat(), S_ISCHR, and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 2015 of file file.c.
References rb_io_t::fd, GetOpenFile, INT2FIX, NIL_P, NUM2INT, rb_io_t::pathv, Qnil, rb_secure(), rb_str_encode_ospath(), rb_sys_fail_path, and RSTRING_PTR.
Referenced by Init_File().
Definition at line 2146 of file file.c.
References chown(), rb_io_t::fd, GetOpenFile, INT2FIX, NIL_P, NUM2INT, rb_io_t::pathv, Qnil, rb_secure(), rb_str_encode_ospath(), rb_sys_fail_path, and RSTRING_PTR.
Referenced by Init_File().
| void rb_file_const | ( | const char * | name, | |
| VALUE | value | |||
| ) |
Definition at line 5095 of file file.c.
References rb_define_const().
Referenced by Init_Dir(), Init_File(), and Init_IO().
Definition at line 1927 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().
Definition at line 1120 of file file.c.
References Qfalse, Qtrue, rb_stat(), S_ISDIR, and stat.
Referenced by Init_Dir(), Init_File(), and rb_f_test().
Definition at line 3749 of file file.c.
References FilePathStringValue, isdirsep, name, OBJ_INFECT, rb_enc_copy(), rb_enc_get(), rb_str_cat(), rb_str_new(), rb_usascii_str_new2, RSTRING_LEN, skipprefix, skiproot(), StringValueCStr, strrdirsep, and top.
Referenced by rb_f_require_relative(), and rb_file_s_dirname().
Definition at line 1439 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().
Definition at line 1457 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().
Definition at line 1286 of file file.c.
References Qfalse, Qtrue, rb_stat(), and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 3276 of file file.c.
References check_expand_path_args, EXPAND_PATH_BUFFER, and rb_file_expand_path_internal().
Referenced by expand_include_path(), rb_file_identical_p(), and rb_file_s_expand_path().
Definition at line 3283 of file file.c.
References check_expand_path_args, EXPAND_PATH_BUFFER, and rb_file_expand_path_internal().
Referenced by rb_feature_provided(), and rb_get_expanded_load_path().
| VALUE rb_file_expand_path_internal | ( | VALUE | fname, | |
| VALUE | dname, | |||
| int | abs_mode, | |||
| int | long_name, | |||
| VALUE | result | |||
| ) |
Definition at line 2922 of file file.c.
References ALLOCA_N, ALLOCV_END, ALLOCV_N, append_fspath(), BUFCHECK, BUFINIT, chompdirsep(), ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAR, Inc, isdirsep, istrailinggarbage, lstat, MAXPATHLEN, my_getcwd, nextdirsep, NIL_P, NULL, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_eArgError, rb_enc_associate(), rb_enc_check(), rb_enc_copy(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_str_coderange(), rb_filesystem_encoding(), rb_home_dir(), rb_is_absolute_path(), rb_raise(), rb_str_buf_cat(), rb_str_encode(), rb_str_encode_ospath(), rb_str_resize(), rb_str_set_len, rb_utf8_encoding(), RSTRING_LEN, RSTRING_PTR, S_ISLNK, skipprefix, skiproot(), stat, STRCASECMP, StringValuePtr, strlcat(), strlen(), strncasecmp, strrdirsep, and TOLOWER.
Referenced by file_expand_path_1(), rb_file_absolute_path(), rb_file_expand_path(), rb_file_expand_path_fast(), rb_find_file_ext_safe(), and rb_find_file_safe().
Definition at line 1479 of file file.c.
References Qfalse, Qtrue, rb_stat(), S_ISREG, and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 4194 of file file.c.
References errno, EWOULDBLOCK, rb_io_t::fd, FMODE_WRITABLE, GetOpenFile, INT2FIX, LOCK_NB, rb_io_t::mode, NUM2INT, rb_io_t::pathv, Qfalse, rb_io_check_closed(), rb_io_flush(), rb_secure(), rb_sys_fail_path, rb_thread_flock(), rb_thread_io_blocking_region(), and rb_thread_polling().
Referenced by Init_File().
| static VALUE rb_file_ftype | ( | const struct stat * | st | ) | [static] |
Definition at line 1726 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().
Definition at line 1563 of file file.c.
References Qfalse, Qtrue, rb_group_member(), rb_stat(), and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 1658 of file file.c.
References access, FilePathValue, Qfalse, Qnil, Qtrue, rb_file_expand_path(), rb_memcicmp(), rb_secure(), rb_stat(), rb_str_encode_ospath(), rb_str_new4, rb_w32_iswin95, RSTRING_LEN, RSTRING_PTR, and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 3943 of file file.c.
References chompdirsep(), file_inspect_join(), FilePathStringValue, isdirsep, name, NIL_P, OBJ_INFECT, RARRAY_LEN, RARRAY_PTR, rb_eArgError, rb_enc_copy(), rb_enc_get(), rb_exec_recursive(), rb_raise(), rb_str_buf_append(), rb_str_buf_new(), rb_str_new(), rb_str_set_len, RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, StringValue, StringValueCStr, T_ARRAY, T_STRING, and TYPE.
Referenced by file_inspect_join(), and rb_file_s_join().
| int rb_file_load_ok | ( | const char * | path | ) |
Definition at line 5208 of file file.c.
Referenced by rb_f_load(), rb_find_file_ext_safe(), and rb_find_file_safe().
Definition at line 974 of file file.c.
References GetOpenFile, lstat, NIL_P, rb_io_t::pathv, Qnil, rb_io_stat(), rb_secure(), rb_str_encode_ospath(), rb_sys_fail_path, RSTRING_PTR, stat, and stat_new().
Referenced by Init_File().
Definition at line 1875 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().
Definition at line 1534 of file file.c.
References geteuid(), Qfalse, Qtrue, rb_stat(), and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 252 of file file.c.
References NIL_P, rb_io_t::pathv, Qnil, rb_io_check_initialized(), rb_io_taint_check(), rb_obj_taint(), rb_str_dup(), and RFILE.
Referenced by Init_File().
Definition at line 1141 of file file.c.
References Qfalse, Qtrue, rb_stat(), and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 1303 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().
Definition at line 1321 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().
Definition at line 3340 of file file.c.
References Qnil, rb_file_absolute_path(), and rb_scan_args().
Referenced by Init_File().
Definition at line 1807 of file file.c.
References FilePathValue, rb_stat(), rb_sys_fail_path, stat, and stat_atime().
Referenced by Init_File().
Definition at line 3682 of file file.c.
References ENC_CODERANGE_7BIT, FilePathStringValue, name, NIL_P, OBJ_INFECT, rb_eEncCompatError, rb_enc_asciicompat, rb_enc_check(), rb_enc_copy(), rb_enc_get(), rb_enc_name, rb_enc_str_coderange(), RB_GC_GUARD, rb_raise(), rb_scan_args(), rb_str_conv_enc(), rb_str_new(), rb_str_new_shared(), rmext(), RSTRING_LEN, RSTRING_PTR, ruby_enc_find_basename(), StringValue, and StringValueCStr.
Referenced by Init_File(), and rb_file_s_split().
Definition at line 1986 of file file.c.
References apply2files(), chmod_internal(), LONG2FIX, NUM2INT, rb_scan_args(), and rb_secure().
Referenced by Init_File().
Definition at line 2105 of file file.c.
References apply2files(), chown_internal(), chown_args::group, LONG2FIX, NIL_P, NUM2GIDT, NUM2UIDT, chown_args::owner, rb_scan_args(), and rb_secure().
Referenced by Init_File().
Definition at line 1902 of file file.c.
References FilePathValue, rb_stat(), rb_sys_fail_path, stat, and stat_ctime().
Referenced by Init_File().
Definition at line 3743 of file file.c.
References rb_file_dirname().
Referenced by Init_File(), and rb_file_s_split().
Definition at line 3307 of file file.c.
References Qnil, rb_file_expand_path(), and rb_scan_args().
Referenced by Init_File().
Definition at line 3878 of file file.c.
References FilePathStringValue, name, OBJ_INFECT, rb_enc_get(), rb_str_new(), rb_str_subseq(), RSTRING_LEN, ruby_enc_find_extname(), and StringValueCStr.
Referenced by Init_File().
Definition at line 1782 of file file.c.
References FilePathValue, lstat, rb_file_ftype(), rb_secure(), rb_str_encode_ospath(), rb_sys_fail_path, stat, and StringValueCStr.
Referenced by Init_File().
Definition at line 942 of file file.c.
References FilePathValue, lstat, rb_file_s_stat(), rb_secure(), rb_str_encode_ospath(), rb_sys_fail_path, stat, stat_new(), and StringValueCStr.
Referenced by Init_File().
Definition at line 1853 of file file.c.
References FilePathValue, rb_stat(), rb_sys_fail_path, stat, and stat_mtime().
Referenced by Init_File().
Definition at line 3554 of file file.c.
References rb_realpath_internal(), and rb_scan_args().
Referenced by Init_File().
Definition at line 3534 of file file.c.
References rb_realpath_internal(), and rb_scan_args().
Referenced by Init_File().
Definition at line 2528 of file file.c.
References errno, FilePathValue, INT2FIX, rb_secure(), rb_str_encode_ospath(), StringValueCStr, and sys_fail2().
Referenced by Init_File().
Definition at line 1714 of file file.c.
References FilePathValue, OFFT2NUM, rb_stat(), rb_sys_fail_path, and stat.
Referenced by Init_File().
Definition at line 3924 of file file.c.
References FilePathStringValue, Qnil, rb_assoc_new(), rb_file_s_basename(), and rb_file_s_dirname().
Referenced by Init_File().
Definition at line 887 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().
Definition at line 2578 of file file.c.
References INT2FIX, NUM2INT, rb_eArgError, rb_raise(), and rb_secure().
Referenced by Init_File().
Definition at line 2508 of file file.c.
References apply2files(), LONG2FIX, rb_secure(), and unlink_internal().
Referenced by Init_File().
Definition at line 2335 of file file.c.
References apply2files(), utime_args::atime, LONG2FIX, utime_args::mtime, NIL_P, NULL, rb_scan_args(), rb_secure(), rb_time_timespec(), utime_args::tsp, and utime_internal().
Referenced by Init_File().
Definition at line 1614 of file file.c.
References Qfalse.
Referenced by Init_File(), and rb_f_test().
Definition at line 1950 of file file.c.
References rb_io_t::fd, FMODE_WRITABLE, fstat, GetOpenFile, rb_io_t::mode, OFFT2NUM, rb_io_t::pathv, rb_io_flush(), rb_sys_fail_path, and stat.
Referenced by Init_File().
Definition at line 1515 of file file.c.
References OFFT2NUM, Qnil, rb_stat(), and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 1202 of file file.c.
References Qfalse, Qtrue, rb_stat(), and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 1631 of file file.c.
References Qnil.
Referenced by Init_File(), and rb_f_test().
Definition at line 1597 of file file.c.
References Qfalse.
Referenced by Init_File(), and rb_f_test().
Definition at line 1165 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().
Definition at line 1375 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().
Definition at line 1393 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().
Definition at line 1497 of file file.c.
References Qfalse, Qtrue, rb_stat(), and stat.
Referenced by Init_File(), and rb_f_test().
Definition at line 5319 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 5244 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 | |||
| ) |
Definition at line 5250 of file file.c.
References copy_path_class(), file_expand_path_1(), FL_TAINT, FL_UNSET, FL_UNTRUSTED, fpath_check, is_explicit_relative(), MAXPATHLEN, OBJ_TAINTED, RARRAY_LEN, RARRAY_PTR, rb_enc_associate_index(), rb_eSecurityError, rb_file_expand_path_internal(), rb_file_load_ok(), RB_GC_GUARD, rb_get_load_path(), rb_get_path_check(), rb_is_absolute_path(), rb_raise(), rb_str_cat2(), rb_str_dup(), rb_str_set_len, rb_str_tmp_new(), rb_usascii_encindex(), RBASIC, RSTRING_LEN, RSTRING_PTR, and StringValueCStr.
Referenced by rb_find_file_ext(), and search_required().
Definition at line 5325 of file file.c.
References copy_path_class(), file_expand_path_1(), fpath_check, is_explicit_relative(), MAXPATHLEN, OBJ_TAINTED, RARRAY_LEN, RARRAY_PTR, rb_enc_associate_index(), rb_eSecurityError, rb_file_expand_path_internal(), rb_file_load_ok(), RB_GC_GUARD, rb_get_load_path(), rb_get_path_check(), rb_is_absolute_path(), rb_raise(), rb_str_tmp_new(), rb_usascii_encindex(), RSTRING_LEN, RSTRING_PTR, and StringValueCStr.
Referenced by rb_find_file(), and search_required().
Definition at line 197 of file file.c.
References rb_get_path_check(), and rb_safe_level().
Referenced by apply2files(), and rb_file_s_path().
Definition at line 157 of file file.c.
References CONST_ID, file_path_convert(), insecure_obj_p, Qundef, rb_check_funcall(), rb_eEncCompatError, rb_enc_asciicompat, rb_enc_get(), rb_enc_name, rb_insecure_operation(), rb_raise(), rb_str_inspect(), rb_str_new4, RSTRING_PTR, StringValue, and StringValueCStr.
Referenced by rb_find_file_ext_safe(), rb_find_file_safe(), rb_get_path(), and rb_get_path_no_checksafe().
Definition at line 191 of file file.c.
References rb_get_path_check().
| static int rb_group_member | ( | GETGROUPS_T | gid | ) | [static] |
Definition at line 995 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().
Definition at line 2857 of file file.c.
References getenv(), Inc, Qnil, rb_eArgError, rb_enc_associate(), rb_filesystem_encoding(), rb_raise(), rb_str_resize(), RSTRING_PTR, and strlen().
Referenced by dir_s_home(), and rb_file_expand_path_internal().
Definition at line 915 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 5101 of file file.c.
References isdirsep.
Referenced by path_check_0(), rb_file_expand_path_internal(), rb_find_file_ext_safe(), and rb_find_file_safe().
| int rb_path_check | ( | const char * | path | ) |
Definition at line 5180 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 2808 of file file.c.
References rb_enc_path_end(), rb_filesystem_encoding(), rb_warn(), and strlen().
| char* rb_path_last_separator | ( | const char * | path | ) |
Definition at line 2802 of file file.c.
References rb_enc_path_last_separator(), rb_filesystem_encoding(), rb_warn(), and strlen().
| char* rb_path_next | ( | const char * | path | ) |
Definition at line 2788 of file file.c.
References rb_enc_path_next(), rb_filesystem_encoding(), rb_warn(), and strlen().
| char* rb_path_skip_prefix | ( | const char * | path | ) |
Definition at line 2795 of file file.c.
References rb_enc_path_skip_prefix(), rb_filesystem_encoding(), rb_warn(), and strlen().
Definition at line 3447 of file file.c.
References chompdirsep(), FilePathValue, Inc, NIL_P, NULL, OBJ_TAINT, Qnil, rb_dir_getwd(), rb_enc_get(), rb_hash_new(), rb_secure(), rb_str_dup_frozen, rb_str_set_len, rb_str_subseq(), realpath_rec(), RSTRING_GETMEM, and skipprefixroot().
Referenced by iseq_s_compile_file(), process_options(), rb_file_s_realdirpath(), rb_file_s_realpath(), rb_load_internal(), and ruby_init_loadpath_safe().
| static int rb_stat | ( | VALUE | file, | |
| struct stat * | st | |||
| ) | [static] |
Definition at line 815 of file file.c.
References rb_io_t::fd, FilePathValue, fstat, GetOpenFile, NIL_P, rb_check_convert_type(), rb_secure(), rb_str_encode_ospath(), STAT, StringValueCStr, and T_FILE.
Referenced by rb_f_test(), rb_file_blockdev_p(), rb_file_chardev_p(), rb_file_directory_p(), rb_file_exist_p(), rb_file_file_p(), rb_file_grpowned_p(), rb_file_identical_p(), rb_file_owned_p(), rb_file_pipe_p(), rb_file_rowned_p(), rb_file_s_atime(), rb_file_s_ctime(), rb_file_s_mtime(), rb_file_s_size(), rb_file_s_stat(), rb_file_size_p(), rb_file_socket_p(), rb_file_world_readable_p(), rb_file_world_writable_p(), and rb_file_zero_p().
Definition at line 700 of file file.c.
References get_stat(), and stat_atime().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 4646 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISBLK.
Referenced by Init_File().
Definition at line 582 of file file.c.
References get_stat(), Qnil, and ULONG2NUM().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 603 of file file.c.
References get_stat(), Qnil, and ULONG2NUM().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 4668 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISCHR.
Referenced by Init_File().
Definition at line 316 of file file.c.
References get_stat(), INT2FIX, Qnil, rb_obj_class(), rb_obj_is_kind_of(), stat_mtimespec(), timespec::tv_nsec, and timespec::tv_sec.
Referenced by Init_File().
Definition at line 736 of file file.c.
References get_stat(), and stat_ctime().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 4560 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISDIR.
Referenced by Init_File().
Definition at line 355 of file file.c.
References DEVT2NUM, and get_stat().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 372 of file file.c.
References get_stat(), INT2NUM(), major, and Qnil.
Referenced by Init_File().
Definition at line 393 of file file.c.
References get_stat(), INT2NUM(), minor, and Qnil.
Referenced by Init_File().
Definition at line 4987 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISREG.
Referenced by Init_File().
Definition at line 4543 of file file.c.
References get_stat(), and rb_file_ftype().
Referenced by Init_File().
Definition at line 486 of file file.c.
References get_stat(), and GIDT2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 4714 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().
Definition at line 4482 of file file.c.
References ALLOC, DATA_PTR, FilePathValue, NULL, Qnil, rb_secure(), rb_str_encode_ospath(), rb_sys_fail_path, STAT, stat, StringValueCStr, and xfree.
Referenced by Init_File().
Definition at line 4505 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().
Definition at line 413 of file file.c.
References get_stat(), and ULONG2NUM().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 756 of file file.c.
References func, name, NUM2DEVT, NUM2ULONG, OBJ_INFECT, PRI_DEVT_PREFIX, rb_inspect(), rb_obj_classname(), rb_sprintf(), rb_stat_atime(), rb_stat_blksize(), rb_stat_blocks(), rb_stat_ctime(), rb_stat_dev(), rb_stat_gid(), rb_stat_ino(), rb_stat_mode(), rb_stat_mtime(), rb_stat_nlink(), rb_stat_rdev(), rb_stat_size(), rb_stat_uid(), rb_str_append(), rb_str_buf_cat2(), rb_str_buf_new2, rb_str_catf(), stat, stat_data_type, and TypedData_Get_Struct.
Referenced by Init_File().
Definition at line 4602 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISLNK.
Referenced by Init_File().
Definition at line 436 of file file.c.
References get_stat(), ST2UINT, and UINT2NUM().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 716 of file file.c.
References get_stat(), and stat_mtime().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 454 of file file.c.
References get_stat(), and UINT2NUM().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 4688 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().
Definition at line 4575 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 4767 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().
Definition at line 4734 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().
Definition at line 504 of file file.c.
References DEVT2NUM, get_stat(), and Qnil.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 525 of file file.c.
References DEVT2NUM, get_stat(), major, and Qnil.
Referenced by Init_File().
Definition at line 546 of file file.c.
References DEVT2NUM, get_stat(), minor, and Qnil.
Referenced by Init_File().
Definition at line 4695 of file file.c.
References get_stat(), getuid(), Qfalse, and Qtrue.
Referenced by rb_stat_R(), rb_stat_W(), and rb_stat_X().
Definition at line 5022 of file file.c.
References get_stat(), off_t, OFFT2NUM, and Qnil.
Referenced by Init_File().
Definition at line 4623 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 5063 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 565 of file file.c.
References get_stat(), and OFFT2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 5084 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 5042 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 470 of file file.c.
References get_stat(), and UIDT2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 4859 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().
Definition at line 4826 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().
Definition at line 4802 of file file.c.
References get_stat(), Qnil, S_IROTH, S_IRUGO, S_IWUGO, S_IXUGO, and UINT2NUM().
Referenced by Init_File().
Definition at line 4894 of file file.c.
References get_stat(), Qnil, S_IRUGO, S_IWOTH, S_IWUGO, S_IXUGO, and UINT2NUM().
Referenced by Init_File().
Definition at line 4952 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().
Definition at line 4920 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().
Definition at line 5005 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 203 of file file.c.
References Qnil, rb_ascii8bit_encoding(), rb_enc_associate(), rb_enc_from_encoding(), rb_enc_get(), rb_filesystem_encoding(), rb_str_dup(), rb_str_encode(), rb_utf8_encoding(), and RSTRING_LEN.
Referenced by apply2files(), check_dirname(), dir_initialize(), dir_s_chdir(), do_opendir(), rb_file_chmod(), rb_file_chown(), rb_file_executable_p(), rb_file_executable_real_p(), rb_file_expand_path_internal(), rb_file_identical_p(), rb_file_lstat(), rb_file_readable_p(), rb_file_readable_real_p(), rb_file_s_ftype(), rb_file_s_lstat(), rb_file_s_rename(), rb_file_symlink_p(), rb_file_writable_p(), rb_file_writable_real_p(), rb_stat(), rb_stat_init(), rb_sysopen(), and realpath_rec().
| static VALUE rb_thread_flock | ( | void * | data | ) | [static] |
Definition at line 4133 of file file.c.
References errno, and flock().
Referenced by rb_file_flock().
| static void realpath_rec | ( | long * | prefixlenp, | |
| VALUE * | resolvedp, | |||
| const char * | unresolved, | |||
| VALUE | loopcheck, | |||
| int | strict, | |||
| int | last | |||
| ) | [static] |
Definition at line 3353 of file file.c.
References CONST_ID, ELOOP, errno, ID2SYM, isdirsep, link(), lstat, NIL_P, Qnil, rb_enc_check(), rb_enc_get(), rb_enc_path_next(), RB_GC_GUARD, rb_hash_aref(), rb_hash_aset(), rb_str_cat(), rb_str_cat2(), rb_str_conv_enc(), rb_str_dup(), rb_str_dup_frozen, rb_str_encode_ospath(), rb_str_resize(), rb_str_subseq(), rb_sys_fail_path, RSTRING_LEN, RSTRING_PTR, S_ISLNK, skipprefixroot(), stat, strlen(), and strrdirsep.
Referenced by rb_realpath_internal().
| static size_t rmext | ( | const char * | p, | |
| long | l0, | |||
| long | l1, | |||
| const char * | e, | |||
| long | l2, | |||
| rb_encoding * | enc | |||
| ) | [static] |
Definition at line 3562 of file file.c.
References fncomp, rb_enc_ascget(), rb_enc_codepoint_len(), and rb_enc_left_char_head.
Referenced by rb_file_s_basename().
| const char* ruby_enc_find_basename | ( | const char * | name, | |
| long * | baselen, | |||
| long * | alllen, | |||
| rb_encoding * | enc | |||
| ) |
Definition at line 3598 of file file.c.
References chompdirsep(), Inc, isdirsep, skipprefix, and strrdirsep.
Referenced by rb_file_s_basename(), and ruby_find_basename().
| const char* ruby_enc_find_extname | ( | const char * | name, | |
| long * | len, | |||
| rb_encoding * | enc | |||
| ) |
Definition at line 3804 of file file.c.
References Inc, isdirsep, istrailinggarbage, long, strlen(), and strrdirsep.
Referenced by path_sub_ext(), rb_file_s_extname(), and ruby_find_extname().
| const char* ruby_find_basename | ( | const char * | name, | |
| long * | baselen, | |||
| long * | alllen | |||
| ) |
Definition at line 3661 of file file.c.
References rb_filesystem_encoding(), rb_warn(), and ruby_enc_find_basename().
| const char* ruby_find_extname | ( | const char * | name, | |
| long * | len | |||
| ) |
Definition at line 3857 of file file.c.
References rb_filesystem_encoding(), rb_warn(), and ruby_enc_find_extname().
| static char* skipprefixroot | ( | const char * | path, | |
| const char * | end, | |||
| rb_encoding * | enc | |||
| ) | [inline, static] |
Definition at line 2734 of file file.c.
References isdirsep, skipprefix, and skiproot().
Referenced by rb_realpath_internal(), and realpath_rec().
| static char* skiproot | ( | const char * | path, | |
| const char * | end, | |||
| rb_encoding * | enc | |||
| ) | [inline, static] |
Definition at line 2688 of file file.c.
References isdirsep.
Referenced by rb_file_dirname(), rb_file_expand_path_internal(), and skipprefixroot().
| static VALUE stat_atime | ( | struct stat * | st | ) | [static] |
Definition at line 634 of file file.c.
References rb_time_nano_new(), stat_atimespec(), timespec::tv_nsec, and timespec::tv_sec.
Referenced by rb_f_test(), rb_file_atime(), rb_file_s_atime(), and rb_stat_atime().
| static struct timespec stat_atimespec | ( | struct stat * | st | ) | [static, read] |
Definition at line 617 of file file.c.
References timespec::tv_nsec, and timespec::tv_sec.
Referenced by stat_atime().
| static VALUE stat_ctime | ( | struct stat * | st | ) | [static] |
Definition at line 682 of file file.c.
References rb_time_nano_new(), stat_ctimespec(), timespec::tv_nsec, and timespec::tv_sec.
Referenced by rb_f_test(), rb_file_ctime(), rb_file_s_ctime(), and rb_stat_ctime().
| static struct timespec stat_ctimespec | ( | struct stat * | st | ) | [static, read] |
Definition at line 665 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] |
| static VALUE stat_mtime | ( | struct stat * | st | ) | [static] |
Definition at line 658 of file file.c.
References rb_time_nano_new(), stat_mtimespec(), timespec::tv_nsec, and timespec::tv_sec.
Referenced by rb_f_test(), rb_file_mtime(), rb_file_s_mtime(), and rb_stat_mtime().
| static struct timespec stat_mtimespec | ( | struct stat * | st | ) | [static, read] |
Definition at line 641 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 286 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().
Definition at line 274 of file file.c.
References ALLOC, stat, stat_data_type, and TypedData_Wrap_Struct.
Referenced by rb_stat_s_alloc(), and stat_new().
Definition at line 2358 of file file.c.
References MAXPATHLEN, rb_str_append(), rb_str_cat2(), rb_str_ellipsize(), rb_str_new_cstr(), and rb_sys_fail_path.
Referenced by rb_file_s_rename().
| static void test_check | ( | int | n, | |
| int | argc, | |||
| VALUE * | argv | |||
| ) | [static] |
Definition at line 4234 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 2491 of file file.c.
References rb_sys_fail_path.
Referenced by rb_file_s_unlink().
| static void utime_internal | ( | const char * | path, | |
| VALUE | pathv, | |||
| void * | arg | |||
| ) | [static] |
Definition at line 2309 of file file.c.
References utimbuf::actime, utime_args::atime, utimbuf::modtime, utime_args::mtime, NULL, utime_args::tsp, timespec::tv_sec, and utime_failed.
Referenced by rb_file_s_utime().
const char null_device[] [static] |
Definition at line 131 of file file.c.
Referenced by argf_next_argv(), console_dev(), copy_stream_body(), Init_Dir(), Init_IO(), path_atime(), path_basename(), path_chmod(), path_chown(), path_ctime(), path_dirname(), path_expand_path(), path_extname(), path_fnmatch(), path_ftype(), path_lchmod(), path_lchown(), path_lstat(), path_make_link(), path_make_symlink(), path_mtime(), path_open(), path_readlink(), path_realdirpath(), path_realpath(), path_rename(), path_split(), path_stat(), path_truncate(), path_utime(), pty_getpty(), pty_open(), rb_f_open(), rb_file_open(), rb_file_open_str(), rb_io_fdopen(), rb_io_open(), rb_io_open_with_args(), and unlink_rescue().
Definition at line 132 of file file.c.
Referenced by path_blockdev_p(), path_chardev_p(), path_directory_p(), path_executable_p(), path_executable_real_p(), path_exist_p(), path_file_p(), path_grpowned_p(), path_owned_p(), path_pipe_p(), path_readable_p(), path_readable_real_p(), path_setgid_p(), path_setuid_p(), path_size(), path_size_p(), path_socket_p(), path_sticky_p(), path_symlink_p(), path_world_readable_p(), path_world_writable_p(), path_writable_p(), path_writable_real_p(), and path_zero_p().
Definition at line 3930 of file file.c.
Referenced by chunk_ii().
const rb_data_type_t stat_data_type [static] |
{
"stat",
{NULL, RUBY_TYPED_DEFAULT_FREE, stat_memsize,},
}
Definition at line 268 of file file.c.
Referenced by get_stat(), rb_stat_inspect(), and stat_new_0().
1.6.1