Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "internal.h"
#include "ruby/io.h"
#include "ruby/util.h"
#include "dln.h"
#include "encindex.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 |
Macros | |
#define | MAXPATHLEN 1024 |
#define | lstat stat |
#define | STAT(p, s) stat((p), (s)) |
#define | insecure_obj_p(obj, level) ((level) > 0 && OBJ_TAINTED(obj)) |
#define | NORMALIZE_UTF8PATH 0 |
#define | apply2args(n) (rb_check_arity(argc, n, UNLIMITED_ARGUMENTS), argc-=n) |
#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 | HAVE_STAT_BIRTHTIME |
#define | rb_stat_birthtime rb_f_notimplement |
#define | S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) |
#define | S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) |
#define | S_ISBLK(m) (0) /* anytime false */ |
#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_birthtime rb_f_notimplement |
#define | rb_file_birthtime rb_f_notimplement |
#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 | syserr_fail2_in(func, e, s1, s2) syserr_fail2(e, s1, s2) |
#define | sys_fail2(s1, s2) syserr_fail2(errno, s1, s2) |
#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 | USE_NTFS_ADS 0 |
#define | istrailinggarbage(x) 0 |
#define | isADS(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 | SKIPPATHSEP(p) 1 |
#define | BUFCOPY(srcptr, srclen) |
#define | WITH_ROOTDIFF(stmt) |
#define | endpwent() ((void)0) |
#define | EXPAND_PATH_BUFFER() rb_usascii_str_new(0, MAXPATHLEN + 2) |
#define | expand_path(fname, dname, abs_mode, long_name, result) str_shrink(rb_file_expand_path_internal(fname, dname, abs_mode, long_name, result)) |
#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 | rb_file_s_mkfifo rb_f_notimplement |
#define | ENABLE_PATH_CHECK 1 |
#define | S_IWOTH 002 |
#define | fpath_check(path) path_check_0((path), FALSE) |
#define | O_BINARY 0 |
#define | O_SHARE_DELETE 0 |
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 apply2args | ( | n | ) | (rb_check_arity(argc, n, UNLIMITED_ARGUMENTS), argc-=n) |
Definition at line 346 of file file.c.
Referenced by rb_file_chmod(), rb_file_chown(), rb_file_s_chmod(), rb_file_s_chown(), and rb_file_s_utime().
#define BUFCHECK | ( | cond | ) |
Definition at line 3133 of file file.c.
Referenced by rb_file_expand_path_internal().
#define BUFCOPY | ( | srcptr, | |
srclen | |||
) |
Definition at line 3155 of file file.c.
Referenced by rb_file_expand_path_internal().
#define BUFINIT | ( | ) |
Definition at line 3144 of file file.c.
Referenced by rb_file_expand_path_internal().
#define CHECK | ( | n | ) | test_check((n), argc, argv) |
Definition at line 4703 of file file.c.
Referenced by rb_f_test().
#define check_expand_path_args | ( | fname, | |
dname | |||
) |
Definition at line 3675 of file file.c.
Referenced by rb_file_absolute_path(), and rb_file_expand_path().
#define DEVT2NUM | ( | v | ) | UINT2NUM(v) |
Definition at line 470 of file file.c.
Referenced by rb_stat_dev(), rb_stat_dev_major(), rb_stat_dev_minor(), rb_stat_rdev(), rb_stat_rdev_major(), and rb_stat_rdev_minor().
#define endpwent | ( | ) | ((void)0) |
Referenced by check_gid_switch(), etc_endpwent(), etc_getpwnam(), rb_default_home_dir(), and rb_home_dir_of().
#define expand_path | ( | fname, | |
dname, | |||
abs_mode, | |||
long_name, | |||
result | |||
) | str_shrink(rb_file_expand_path_internal(fname, dname, abs_mode, long_name, result)) |
Definition at line 3672 of file file.c.
Referenced by rb_file_absolute_path(), rb_file_expand_path(), and rb_file_expand_path_fast().
#define EXPAND_PATH_BUFFER | ( | ) | rb_usascii_str_new(0, MAXPATHLEN + 2) |
Definition at line 3663 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 5664 of file file.c.
Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().
#define Inc | ( | p, | |
e, | |||
enc | |||
) | ((p) = Next((p), (e), (enc))) |
Definition at line 2945 of file file.c.
Referenced by chompdirsep(), copy_home_path(), rb_enc_path_end(), rb_enc_path_last_separator(), rb_enc_path_next(), rb_file_expand_path_internal(), rb_realpath_internal(), ruby_enc_find_basename(), and ruby_enc_find_extname().
#define insecure_obj_p | ( | obj, | |
level | |||
) | ((level) > 0 && OBJ_TAINTED(obj)) |
Definition at line 133 of file file.c.
Referenced by rb_get_path_check_convert(), and rb_get_path_check_to_string().
#define isADS | ( | x | ) | 0 |
Definition at line 2941 of file file.c.
Referenced by rb_enc_path_end(), rb_file_expand_path_internal(), and ruby_enc_find_extname().
#define isdirsep | ( | x | ) | ((x) == '/') |
Definition at line 2915 of file file.c.
Referenced by chompdirsep(), is_explicit_relative(), rb_enc_path_end(), rb_enc_path_last_separator(), rb_enc_path_next(), rb_enc_path_skip_prefix(), rb_file_dirname(), rb_file_expand_path_internal(), rb_file_join(), rb_is_absolute_path(), realpath_rec(), ruby_enc_find_basename(), ruby_enc_find_extname(), skipprefixroot(), and skiproot().
#define istrailinggarbage | ( | x | ) | 0 |
Definition at line 2936 of file file.c.
Referenced by rb_enc_path_end(), rb_file_expand_path_internal(), and ruby_enc_find_extname().
#define LOCK_EX 2 |
Definition at line 4572 of file file.c.
Referenced by flock_winnt(), and Init_File().
#define LOCK_NB 4 |
Definition at line 4575 of file file.c.
Referenced by flock_winnt(), Init_File(), and rb_file_flock().
#define LOCK_SH 1 |
Definition at line 4569 of file file.c.
Referenced by flock_winnt(), and Init_File().
#define LOCK_UN 8 |
Definition at line 4578 of file file.c.
Referenced by flock_winnt(), and Init_File().
#define lstat stat |
Definition at line 96 of file file.c.
Referenced by rb_file_expand_path_internal(), rb_file_lstat(), rb_file_s_ftype(), rb_file_s_lstat(), rb_file_symlink_p(), and realpath_rec().
#define MAXPATHLEN 1024 |
Definition at line 49 of file file.c.
Referenced by rb_file_expand_path_internal(), rb_find_file_ext_safe(), rb_find_file_safe(), and syserr_fail2_in().
#define Next | ( | p, | |
e, | |||
enc | |||
) | ((p) + rb_enc_mbclen((p), (e), (enc))) |
#define nextdirsep rb_enc_path_next |
Definition at line 3018 of file file.c.
Referenced by rb_file_expand_path_internal().
#define NORMALIZE_UTF8PATH 0 |
Definition at line 343 of file file.c.
Referenced by append_fspath().
#define NUM2DEVT | ( | v | ) | NUM2UINT(v) |
Definition at line 467 of file file.c.
Referenced by rb_stat_inspect().
#define O_BINARY 0 |
Referenced by Init_File().
#define O_SHARE_DELETE 0 |
Referenced by Init_File(), and w32_wopen().
#define PRI_DEVT_PREFIX "" |
Definition at line 473 of file file.c.
Referenced by rb_stat_inspect().
#define rb_file_birthtime rb_f_notimplement |
Definition at line 2254 of file file.c.
Referenced by Init_File().
#define rb_file_s_birthtime rb_f_notimplement |
Definition at line 2225 of file file.c.
Referenced by Init_File(), and rb_file_ctime().
#define rb_file_s_lchmod rb_f_notimplement |
Definition at line 2387 of file file.c.
Referenced by Init_File(), and rb_file_chmod().
#define rb_file_s_lchown rb_f_notimplement |
Definition at line 2521 of file file.c.
Referenced by Init_File(), and rb_file_chown().
#define rb_file_s_link rb_f_notimplement |
Definition at line 2720 of file file.c.
Referenced by Init_File(), and syserr_fail2_in().
#define rb_file_s_mkfifo rb_f_notimplement |
Definition at line 5579 of file file.c.
Referenced by Init_File(), and rb_stat_sticky().
#define rb_file_s_readlink rb_f_notimplement |
Definition at line 2802 of file file.c.
Referenced by Init_File().
#define rb_file_s_symlink rb_f_notimplement |
Definition at line 2750 of file file.c.
Referenced by Init_File().
#define rb_file_s_truncate rb_f_notimplement |
Definition at line 4518 of file file.c.
Referenced by Init_File(), and rb_file_s_join().
#define rb_file_truncate rb_f_notimplement |
Definition at line 4565 of file file.c.
Referenced by Init_File().
#define rb_stat_birthtime rb_f_notimplement |
Definition at line 927 of file file.c.
Referenced by Init_File(), rb_stat_ctime(), and rb_stat_inspect().
Definition at line 1577 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) /* anytime false */ |
Referenced by rb_file_blockdev_p(), rb_file_ftype(), and rb_stat_b().
#define S_ISCHR | ( | m | ) | (((m) & S_IFMT) == S_IFCHR) |
Referenced by rb_file_chardev_p(), rb_file_ftype(), and rb_stat_c().
#define S_ISDIR | ( | m | ) | (((m) & S_IFMT) == S_IFDIR) |
Referenced by path_check_0(), rb_file_directory_p(), rb_file_ftype(), rb_stat_d(), and ruby_is_fd_loadable().
#define S_ISREG | ( | m | ) | (((m) & S_IFMT) == S_IFREG) |
Definition at line 1713 of file file.c.
Referenced by rb_file_file_p(), rb_file_ftype(), rb_stat_f(), and ruby_is_fd_loadable().
#define S_IWOTH 002 |
Referenced by path_check_0(), rb_file_world_writable_p(), rb_stat_w(), rb_stat_W(), and rb_stat_ww().
Definition at line 1581 of file file.c.
Referenced by rb_file_world_readable_p(), rb_file_world_writable_p(), rb_stat_wr(), and rb_stat_ww().
Definition at line 1249 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 3031 of file file.c.
Referenced by rb_file_dirname(), rb_file_expand_path_internal(), ruby_enc_find_basename(), and skipprefixroot().
Definition at line 464 of file file.c.
Referenced by rb_stat_mode().
#define STAT | ( | p, | |
s | |||
) | stat((p), (s)) |
Definition at line 126 of file file.c.
Referenced by eaccess(), path_check_0(), rb_file_grpowned_p(), rb_stat(), and rb_stat_init().
#define strrdirsep rb_enc_path_last_separator |
Definition at line 3066 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 sys_fail2 | ( | s1, | |
s2 | |||
) | syserr_fail2(errno, s1, s2) |
Definition at line 2666 of file file.c.
Referenced by syserr_fail2_in().
#define syserr_fail2_in | ( | func, | |
e, | |||
s1, | |||
s2 | |||
) | syserr_fail2(e, s1, s2) |
#define utime_failed | ( | path, | |
tsp, | |||
atime, | |||
mtime | |||
) | rb_sys_fail_path(path) |
Definition at line 2564 of file file.c.
Referenced by utime_internal().
#define WITH_ROOTDIFF | ( | stmt | ) |
Definition at line 3164 of file file.c.
Referenced by rb_file_expand_path_internal().
|
static |
Definition at line 3280 of file file.c.
References buf, memcpy, NIL_P, NORMALIZE_UTF8PATH, ospath_new(), Qnil, rb_enc_associate(), rb_enc_check(), rb_str_capacity(), rb_str_conv_enc(), rb_str_resize(), RSTRING_GETMEM, RSTRING_PTR, strlen(), and xfree().
Referenced by rb_file_expand_path_internal().
|
static |
Definition at line 349 of file file.c.
References argc, LONG2FIX, gzfile::path, rb_get_path(), rb_str_encode_ospath(), and RSTRING_PTR.
Referenced by rb_file_chmod(), rb_file_chown(), rb_file_s_chmod(), rb_file_s_chown(), rb_file_s_unlink(), and rb_file_s_utime().
|
static |
Definition at line 157 of file file.c.
References gzfile::enc, PRIsVALUE, rb_eEncCompatError, rb_enc_asciicompat, rb_enc_get(), rb_enc_name, rb_raise(), and rb_str_inspect().
Referenced by rb_file_join(), rb_file_s_basename(), and rb_get_path_check_convert().
Definition at line 2284 of file file.c.
References rb_sys_fail_path.
Referenced by rb_file_s_chmod().
|
static |
Definition at line 3086 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().
Definition at line 2414 of file file.c.
References chown(), chown_args::group, chown_args::owner, and rb_sys_fail_path.
Referenced by rb_file_s_chown().
Definition at line 3171 of file file.c.
References buf, Inc, memcpy, rb_enc_associate_index(), rb_enc_from_index(), rb_filesystem_encindex(), rb_str_resize(), result, RSTRING_PTR, and strlen().
Referenced by rb_default_home_dir(), and rb_home_dir_of().
Definition at line 5756 of file file.c.
References OBJ_FREEZE, rb_obj_class(), RBASIC_SET_CLASS, and str_shrink().
Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().
Definition at line 5900 of file file.c.
References func, rb_cFile, rb_define_module_function(), rb_define_singleton_method(), and rb_mFileTest.
Referenced by Init_File().
int eaccess | ( | const char * | path, |
int | mode | ||
) |
Definition at line 1267 of file file.c.
References access, getegid(), geteuid(), getgid(), getuid(), rb_group_member(), S_IXUGO, 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 3680 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 4365 of file file.c.
References rb_eArgError, rb_file_join(), and rb_raise().
Referenced by rb_file_join().
Definition at line 136 of file file.c.
References ENCINDEX_ASCII, ENCINDEX_US_ASCII, ENCODING_GET, name, rb_default_internal_encoding(), rb_enc_from_index(), rb_enc_str_asciionly_p(), rb_filesystem_encindex(), and rb_str_conv_enc().
Referenced by rb_get_path_check_convert().
int flock | ( | int | , |
int | |||
) |
Definition at line 125 of file flock.c.
Referenced by ioctl_narg_len(), and rb_thread_flock().
Definition at line 422 of file file.c.
References rb_eTypeError, rb_raise(), stat, 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 5953 of file file.c.
References define_filetest_function(), INT2FIX, LOCK_EX, LOCK_NB, LOCK_SH, LOCK_UN, O_BINARY, O_NONBLOCK, O_SHARE_DELETE, PATH_SEP, Qnil, rb_cFile, rb_cIO, rb_cObject, rb_cStat, 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_birthtime, rb_file_blockdev_p(), rb_file_chardev_p(), rb_file_chmod(), rb_file_chown(), rb_file_ctime(), rb_file_directory_p(), rb_file_executable_p(), rb_file_executable_real_p(), rb_file_exist_p(), rb_file_exists_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_birthtime, 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_mkfifo, 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_mFileTest, rb_obj_freeze(), rb_stat_atime(), rb_stat_b(), rb_stat_birthtime, 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 |
Definition at line 5748 of file file.c.
References isdirsep.
Referenced by rb_find_file_ext_safe(), and rb_find_file_safe().
NORETURN | ( | static void | syserr_fail2_inconst char *, int, VALUE, VALUE | ) |
|
static |
Definition at line 3268 of file file.c.
References rb_enc_associate(), and rb_enc_str_new().
Referenced by append_fspath().
|
static |
Definition at line 5615 of file file.c.
References access, buf, 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, StringValueCStr, strrdirsep, W_OK, and xfree().
Referenced by rb_path_check().
Definition at line 3238 of file file.c.
Referenced by dir_s_home(), and rb_file_expand_path_internal().
char* rb_enc_path_end | ( | const char * | path, |
const char * | end, | ||
rb_encoding * | enc | ||
) |
Definition at line 3102 of file file.c.
References chompdirsep(), Inc, isADS, isdirsep, istrailinggarbage, and last.
Referenced by check_dirname().
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 3020 of file file.c.
Referenced by rb_enc_path_skip_prefix(), and realpath_rec().
char* rb_enc_path_skip_prefix | ( | const char * | path, |
const char * | end, | ||
rb_encoding * | enc | ||
) |
Definition at line 3034 of file file.c.
References isdirsep, and rb_enc_path_next().
Referenced by check_dirname(), and ruby_glob0().
Definition at line 4764 of file file.c.
References CHECK, errno, FilePathValue, ISPRINT, NUM2CHR, Qfalse, Qtrue, rb_check_arity, 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_syserr_fail_path, stat_atime(), stat_ctime(), stat_mtime(), stat_mtimespec(), strchr(), timespec::tv_nsec, and timespec::tv_sec.
Referenced by Init_File().
Definition at line 3734 of file file.c.
References check_expand_path_args, expand_path, and EXPAND_PATH_BUFFER.
Referenced by rb_f_require_relative(), and rb_file_s_absolute_path().
Definition at line 2082 of file file.c.
References rb_io_t::fd, fstat, GetOpenFile, rb_io_t::pathv, rb_sys_fail_path, and stat_atime().
Referenced by Init_File().
Definition at line 1457 of file file.c.
References Qfalse, Qtrue, rb_stat(), and S_ISBLK.
Referenced by Init_File(), and rb_f_test().
Definition at line 1486 of file file.c.
References Qfalse, Qtrue, rb_stat(), and S_ISCHR.
Referenced by Init_File(), and rb_f_test().
Definition at line 2328 of file file.c.
References apply2args, apply2files(), argc, argv, errno, fchmod(), rb_io_t::fd, GetOpenFile, HAVE_FCHMOD, INT2FIX, NIL_P, NUM2INT, rb_io_t::pathv, Qnil, rb_file_s_lchmod, rb_str_encode_ospath(), rb_sys_fail_path, and RSTRING_PTR.
Referenced by Init_File().
Definition at line 2464 of file file.c.
References apply2args, apply2files(), chown(), rb_io_t::fd, GetOpenFile, chown_args::group, INT2FIX, lchown(), NIL_P, chown_args::owner, rb_io_t::pathv, Qnil, rb_file_s_lchown, rb_str_encode_ospath(), rb_sys_fail_path, RSTRING_PTR, to_gid(), and to_uid().
Referenced by Init_File().
Definition at line 2185 of file file.c.
References errno, rb_io_t::fd, FilePathValue, fstat, GetOpenFile, rb_io_t::pathv, rb_file_s_birthtime, rb_stat(), rb_sys_fail_path, rb_syserr_fail_path, and stat_ctime().
Referenced by Init_File().
Definition at line 1336 of file file.c.
References Qfalse, Qtrue, rb_stat(), and S_ISDIR.
Referenced by dir_s_home(), Init_Dir(), Init_File(), rb_dir_exists_p(), and rb_f_test().
Definition at line 4177 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 f_current_dirname(), rb_f_require_relative(), rb_file_s_dirname(), and rb_file_s_split().
Definition at line 1687 of file file.c.
References eaccess(), FilePathValue, Qfalse, Qtrue, rb_str_encode_ospath(), StringValueCStr, and X_OK.
Referenced by Init_File(), and rb_f_test().
Definition at line 1704 of file file.c.
References access, FilePathValue, Qfalse, Qtrue, rb_str_encode_ospath(), StringValueCStr, and X_OK.
Referenced by Init_File(), and rb_f_test().
Definition at line 1512 of file file.c.
References Qfalse, Qtrue, and rb_stat().
Referenced by Init_File(), rb_f_test(), and rb_file_exists_p().
Definition at line 1527 of file file.c.
References rb_cFile, rb_class_inherited_p(), rb_file_exist_p(), rb_mFileTest, RB_TYPE_P, rb_warning(), RTEST, and T_CLASS.
Referenced by Init_File().
Definition at line 3686 of file file.c.
References check_expand_path_args, expand_path, and EXPAND_PATH_BUFFER.
Referenced by expand_include_path(), and rb_file_s_expand_path().
Definition at line 3693 of file file.c.
References expand_path, and EXPAND_PATH_BUFFER.
Referenced by rb_construct_expanded_load_path(), and rb_feature_provided().
VALUE rb_file_expand_path_internal | ( | VALUE | fname, |
VALUE | dname, | ||
int | abs_mode, | ||
int | long_name, | ||
VALUE | result | ||
) |
Definition at line 3308 of file file.c.
Referenced by file_expand_path_1(), rb_file_expand_path_internal(), rb_find_file_ext_safe(), and rb_find_file_safe().
Definition at line 1729 of file file.c.
References Qfalse, Qtrue, rb_stat(), and S_ISREG.
Referenced by Init_File(), and rb_f_test().
Definition at line 4647 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_raw(), rb_syserr_fail_path, rb_thread_flock(), rb_thread_io_blocking_region(), rb_thread_wait_for(), timeval::tv_sec, and timeval::tv_usec.
Referenced by Init_File().
Definition at line 1976 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 1821 of file file.c.
References FilePathValue, Qfalse, Qtrue, rb_group_member(), rb_stat(), rb_str_encode_ospath(), STAT, and StringValueCStr.
Referenced by Init_File(), and rb_f_test().
Definition at line 1917 of file file.c.
References Qfalse, Qtrue, rb_ensure(), and rb_stat().
Referenced by Init_File(), and rb_f_test().
Definition at line 4373 of file file.c.
References check_path_encoding(), chompdirsep(), FALSE, file_inspect_join(), FilePathStringValue, isdirsep, len, name, NIL_P, OBJ_BUILTIN_TYPE, OBJ_INFECT, RARRAY_AREF, RARRAY_LEN, rb_cString, rb_eArgError, rb_enc_associate(), rb_enc_check(), 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, RBASIC_CLEAR_CLASS, RBASIC_SET_CLASS_RAW, result, RSTRING_GETMEM, RSTRING_LEN, RSTRING_PTR, StringValue, StringValueCStr, T_ARRAY, T_STRING, and TRUE.
Referenced by file_inspect_join(), and rb_file_s_join().
int rb_file_load_ok | ( | const char * | path | ) |
Definition at line 5724 of file file.c.
Referenced by rb_f_load(), rb_find_file_ext_safe(), and rb_find_file_safe().
Definition at line 1182 of file file.c.
References GetOpenFile, lstat, NIL_P, rb_io_t::pathv, Qnil, rb_io_stat(), rb_stat_new(), rb_str_encode_ospath(), rb_sys_fail_path, and RSTRING_PTR.
Referenced by Init_File().
Definition at line 2130 of file file.c.
References rb_io_t::fd, fstat, GetOpenFile, rb_io_t::pathv, rb_sys_fail_path, and stat_mtime().
Referenced by Init_File().
Definition at line 1790 of file file.c.
References geteuid(), Qfalse, Qtrue, and rb_stat().
Referenced by Init_File(), and rb_f_test().
Definition at line 379 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 1359 of file file.c.
References Qfalse, Qtrue, and rb_stat().
Referenced by Init_File(), and rb_f_test().
Definition at line 1551 of file file.c.
References eaccess(), FilePathValue, Qfalse, Qtrue, R_OK, rb_str_encode_ospath(), and StringValueCStr.
Referenced by Init_File(), and rb_f_test().
Definition at line 1568 of file file.c.
References access, FilePathValue, Qfalse, Qtrue, R_OK, rb_str_encode_ospath(), and StringValueCStr.
Referenced by Init_File(), and rb_f_test().
Definition at line 3754 of file file.c.
References Qnil, rb_check_arity, and rb_file_absolute_path().
Referenced by Init_File().
Definition at line 2058 of file file.c.
References errno, FilePathValue, rb_stat(), rb_syserr_fail_path, and stat_atime().
Referenced by Init_File().
Definition at line 4114 of file file.c.
References check_path_encoding(), f, FilePathStringValue, name, NIL_P, OBJ_INFECT, Qnil, rb_check_arity, rb_enc_compatible(), rb_enc_copy(), rb_enc_get(), RB_GC_GUARD, 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 2304 of file file.c.
References apply2args, apply2files(), chmod_internal(), and NUM2INT.
Referenced by Init_File().
Definition at line 2437 of file file.c.
References apply2args, apply2files(), chown_internal(), chown_args::group, chown_args::owner, to_gid(), and to_uid().
Referenced by Init_File().
Definition at line 2159 of file file.c.
References errno, FilePathValue, rb_stat(), rb_syserr_fail_path, and stat_ctime().
Referenced by Init_File().
Definition at line 3727 of file file.c.
References Qnil, rb_check_arity, and rb_file_expand_path().
Referenced by Init_File().
Definition at line 4308 of file file.c.
References FilePathStringValue, len, 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 2032 of file file.c.
References FilePathValue, lstat, rb_file_ftype(), rb_str_encode_ospath(), rb_sys_fail_path, and StringValueCStr.
Referenced by Init_File().
Definition at line 4460 of file file.c.
References errno, FilePathValue, INT2FIX, len, off_t, rb_cloexec_open(), rb_file_join(), rb_file_s_truncate, rb_str_encode_ospath(), rb_sys_fail_path, rb_syserr_fail_path, rb_update_max_fd(), StringValueCStr, and truncate().
Referenced by Init_File().
Definition at line 1151 of file file.c.
References FilePathValue, lstat, rb_file_s_stat(), rb_stat_new(), rb_str_encode_ospath(), rb_sys_fail_path, and StringValueCStr.
Referenced by Init_File().
Definition at line 2107 of file file.c.
References errno, FilePathValue, rb_stat(), rb_syserr_fail_path, and stat_mtime().
Referenced by Init_File().
Definition at line 3989 of file file.c.
References FilePathValue, Qnil, rb_check_arity, and rb_realpath_internal().
Referenced by Init_File().
Definition at line 3968 of file file.c.
References FilePathValue, Qnil, rb_check_arity, and rb_realpath_internal().
Referenced by Init_File().
Definition at line 2839 of file file.c.
References errno, f, FilePathValue, INT2FIX, rb_str_encode_ospath(), and StringValueCStr.
Referenced by Init_File().
Definition at line 1963 of file file.c.
References errno, FilePathValue, OFFT2NUM, rb_stat(), and rb_syserr_fail_path.
Referenced by Init_File().
Definition at line 4354 of file file.c.
References FilePathStringValue, rb_assoc_new(), rb_file_dirname(), and rb_file_s_basename().
Referenced by Init_File().
Definition at line 1097 of file file.c.
References FilePathValue, rb_stat(), rb_stat_new(), and rb_sys_fail_path.
Referenced by Init_File(), and rb_file_s_lstat().
Definition at line 2886 of file file.c.
References INT2FIX, NUM2INT, rb_check_arity, and umask().
Referenced by Init_File().
Definition at line 2823 of file file.c.
References apply2files(), and unlink_internal().
Referenced by Init_File().
Definition at line 2639 of file file.c.
References apply2args, apply2files(), utime_args::atime, utime_args::mtime, NIL_P, NULL, rb_time_timespec(), utime_args::tsp, and utime_internal().
Referenced by Init_File().
Definition at line 1871 of file file.c.
References Qfalse.
Referenced by Init_File(), and rb_f_test().
Definition at line 2268 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_raw(), and rb_sys_fail_path.
Referenced by Init_File().
Definition at line 1769 of file file.c.
References OFFT2NUM, Qnil, and rb_stat().
Referenced by Init_File(), and rb_f_test().
Definition at line 1421 of file file.c.
References Qfalse, Qtrue, and rb_stat().
Referenced by Init_File(), and rb_f_test().
Definition at line 1888 of file file.c.
References Qnil.
Referenced by Init_File(), and rb_f_test().
Definition at line 1854 of file file.c.
References Qfalse.
Referenced by Init_File(), and rb_f_test().
Definition at line 1383 of file file.c.
References FilePathValue, lstat, Qfalse, Qtrue, rb_str_encode_ospath(), S_ISLNK, and StringValueCStr.
Referenced by Init_File(), and rb_f_test().
Definition at line 1623 of file file.c.
References eaccess(), FilePathValue, Qfalse, Qtrue, rb_str_encode_ospath(), StringValueCStr, and W_OK.
Referenced by Init_File(), and rb_f_test().
Definition at line 1640 of file file.c.
References access, FilePathValue, Qfalse, Qtrue, rb_str_encode_ospath(), StringValueCStr, and W_OK.
Referenced by Init_File(), and rb_f_test().
Definition at line 1749 of file file.c.
References Qfalse, Qtrue, and rb_stat().
Referenced by Init_File(), and rb_f_test().
Definition at line 5837 of file file.c.
References rb_find_file_safe(), and rb_safe_level().
Referenced by file_to_load(), and rb_f_load().
Definition at line 5765 of file file.c.
References rb_find_file_ext_safe(), and rb_safe_level().
Definition at line 5771 of file file.c.
References copy_path_class(), f, file_expand_path_1(), FL_TAINT, FL_UNSET, fpath_check, is_explicit_relative(), MAXPATHLEN, OBJ_TAINTED, RARRAY_AREF, RARRAY_LEN, rb_enc_associate_index(), rb_eSecurityError, rb_file_expand_path_internal(), rb_file_load_ok(), RB_GC_GUARD, rb_get_expanded_load_path(), rb_get_path_check(), rb_is_absolute_path(), rb_raise(), rb_str_cat2(), rb_str_dup(), rb_str_resize(), rb_str_set_len(), rb_str_tmp_new(), rb_usascii_encindex(), RBASIC_CLEAR_CLASS, RSTRING_LEN, RSTRING_PTR, and StringValueCStr.
Referenced by rb_find_file_ext(), and search_required().
Definition at line 5843 of file file.c.
References copy_path_class(), f, file_expand_path_1(), fpath_check, is_explicit_relative(), MAXPATHLEN, OBJ_TAINTED, RARRAY_AREF, RARRAY_LEN, rb_enc_associate_index(), rb_eSecurityError, rb_file_expand_path_internal(), rb_file_load_ok(), RB_GC_GUARD, rb_get_expanded_load_path(), rb_get_path_check(), rb_is_absolute_path(), rb_raise(), rb_str_resize(), rb_str_tmp_new(), rb_usascii_encindex(), RSTRING_LEN, RSTRING_PTR, and StringValueCStr.
Referenced by rb_find_file(), and search_required().
Definition at line 217 of file file.c.
References rb_get_path_check(), and rb_safe_level().
Referenced by apply2files(), rb_feature_provided(), and rb_file_s_path().
Definition at line 204 of file file.c.
References rb_get_path_check_convert(), and rb_get_path_check_to_string().
Referenced by rb_find_file_ext_safe(), rb_find_file_safe(), rb_get_path(), and rb_get_path_no_checksafe().
Definition at line 190 of file file.c.
References check_path_encoding(), file_path_convert(), insecure_obj_p, rb_insecure_operation(), rb_str_new4, and StringValueCStr.
Referenced by rb_construct_expanded_load_path(), and rb_get_path_check().
Definition at line 168 of file file.c.
References CONST_ID, insecure_obj_p, Qundef, rb_check_funcall(), rb_insecure_operation(), RB_TYPE_P, StringValue, and T_STRING.
Referenced by rb_construct_expanded_load_path(), rb_f_load(), and rb_get_path_check().
Definition at line 211 of file file.c.
References rb_get_path_check().
|
static |
Definition at line 1202 of file file.c.
References ALLOCV_END, ALLOCV_N, FALSE, getegid(), getgid(), RB_MAX_GROUPS, and TRUE.
Referenced by eaccess(), rb_file_grpowned_p(), rb_stat_grpowned(), rb_stat_R(), rb_stat_W(), and rb_stat_X().
Definition at line 3198 of file file.c.
References copy_home_path(), endpwent, getenv, getlogin(), PRIsVALUE, rb_eArgError, rb_enc_get(), rb_filesystem_encoding(), rb_raise(), rb_str_conv_enc(), rb_utf8_encoding(), result, RSTRING_PTR, and strcasecmp.
Referenced by dir_s_home(), and rb_file_expand_path_internal().
Definition at line 1124 of file file.c.
References rb_io_t::fd, fstat, GetOpenFile, rb_io_t::pathv, rb_stat_new(), and rb_sys_fail_path.
Referenced by Init_File(), and rb_file_lstat().
int rb_is_absolute_path | ( | const char * | path | ) |
Definition at line 5591 of file file.c.
References isdirsep.
Referenced by path_check_0(), rb_construct_expanded_load_path(), 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 5670 of file file.c.
References path_check_0(), PATH_SEP_CHAR, rb_str_new(), strchr(), strlen(), and TRUE.
Referenced by path_tainted_p().
Definition at line 3873 of file file.c.
References chompdirsep(), ENCINDEX_ASCII, ENCINDEX_US_ASCII, FilePathValue, Inc, len, NIL_P, NULL, OBJ_TAINT, Qnil, rb_dir_getwd(), rb_enc_associate(), rb_enc_associate_index(), rb_enc_get(), rb_enc_str_asciionly_p(), rb_enc_to_index(), rb_filesystem_encindex(), rb_hash_new(), rb_str_dup_frozen(), rb_str_set_len(), rb_str_subseq(), realpath_rec(), RSTRING_GETMEM, and skipprefixroot().
Referenced by iseqw_s_compile_file(), process_options(), rb_file_s_realdirpath(), rb_file_s_realpath(), rb_load_internal0(), realpath_rec(), and ruby_init_loadpath().
Definition at line 1008 of file file.c.
References ALLOCV_END, ALLOCV_N, f, rb_io_t::fd, FilePathValue, fstat, GetOpenFile, len, NIL_P, NULL, Qfalse, rb_check_convert_type(), rb_str_encode_ospath(), rb_w32_get_osfhandle(), RSTRING_PTR, STAT, StringValueCStr, and T_FILE.
Referenced by rb_f_test(), rb_file_blockdev_p(), rb_file_chardev_p(), rb_file_ctime(), 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 857 of file file.c.
References get_stat(), and stat_atime().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 5096 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISBLK.
Referenced by Init_File().
Definition at line 725 of file file.c.
References get_stat(), Qnil, and ULONG2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 746 of file file.c.
References get_stat(), Qnil, and ULONG2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 5118 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISCHR.
Referenced by Init_File().
Definition at line 448 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 893 of file file.c.
References get_stat(), rb_stat_birthtime, and stat_ctime().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 5010 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISDIR.
Referenced by Init_File().
Definition at line 487 of file file.c.
References DEVT2NUM, and get_stat().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 504 of file file.c.
References DEVT2NUM, get_stat(), and Qnil.
Referenced by Init_File().
Definition at line 525 of file file.c.
References DEVT2NUM, get_stat(), and Qnil.
Referenced by Init_File().
Definition at line 5439 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISREG.
Referenced by Init_File().
Definition at line 4993 of file file.c.
References get_stat(), and rb_file_ftype().
Referenced by Init_File().
Definition at line 629 of file file.c.
References get_stat(), and GIDT2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 5164 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 4938 of file file.c.
References ALLOC, DATA_PTR, FilePathValue, NULL, Qnil, rb_str_encode_ospath(), rb_sys_fail_path, STAT, StringValueCStr, and xfree().
Referenced by Init_File().
Definition at line 4960 of file file.c.
References ALLOC, DATA_PTR, OBJ_INIT_COPY, and xfree().
Referenced by Init_File().
Definition at line 545 of file file.c.
References get_stat(), and ULONG2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 946 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_birthtime, 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(), and TypedData_Get_Struct.
Referenced by Init_File().
Definition at line 5052 of file file.c.
References get_stat(), Qfalse, Qtrue, and S_ISLNK.
Referenced by Init_File().
Definition at line 579 of file file.c.
References get_stat(), ST2UINT, and UINT2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 873 of file file.c.
References get_stat(), and stat_mtime().
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 416 of file file.c.
References rb_cStat, stat, and stat_new_0().
Referenced by rb_file_lstat(), rb_file_s_lstat(), rb_file_s_stat(), and rb_io_stat().
Definition at line 597 of file file.c.
References get_stat(), and UINT2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 5138 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 5025 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 5184 of file file.c.
References get_stat(), geteuid(), Qfalse, Qtrue, rb_stat_grpowned(), rb_stat_owned(), S_IRGRP, S_IROTH, and S_IRUSR.
Referenced by Init_File().
Definition at line 5217 of file file.c.
References get_stat(), getuid(), Qfalse, Qtrue, rb_group_member(), rb_stat_rowned(), S_IRGRP, S_IROTH, and S_IRUSR.
Referenced by Init_File().
Definition at line 647 of file file.c.
References DEVT2NUM, get_stat(), and Qnil.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 668 of file file.c.
References DEVT2NUM, get_stat(), and Qnil.
Referenced by Init_File().
Definition at line 689 of file file.c.
References DEVT2NUM, get_stat(), and Qnil.
Referenced by Init_File().
Definition at line 5145 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 5073 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 5474 of file file.c.
References get_stat(), off_t, OFFT2NUM, Qnil, and size.
Referenced by Init_File().
Definition at line 5515 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 708 of file file.c.
References get_stat(), and OFFT2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 5536 of file file.c.
References FilePathValue, get_stat(), INT2FIX, NUM2INT, Qfalse, Qtrue, rb_check_arity, rb_file_s_mkfifo, rb_str_encode_ospath(), rb_sys_fail_path, and RSTRING_PTR.
Referenced by Init_File().
Definition at line 5494 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 613 of file file.c.
References get_stat(), and UIDT2NUM.
Referenced by Init_File(), and rb_stat_inspect().
Definition at line 5277 of file file.c.
References get_stat(), geteuid(), Qfalse, Qtrue, rb_stat_grpowned(), rb_stat_owned(), S_IWGRP, S_IWOTH, and S_IWUSR.
Referenced by Init_File().
Definition at line 5310 of file file.c.
References get_stat(), getuid(), Qfalse, Qtrue, rb_group_member(), rb_stat_rowned(), S_IWGRP, S_IWOTH, and S_IWUSR.
Referenced by Init_File().
Definition at line 5252 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 5345 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 5372 of file file.c.
References get_stat(), geteuid(), Qfalse, Qtrue, rb_stat_grpowned(), rb_stat_owned(), S_IXGRP, S_IXOTH, S_IXUGO, and S_IXUSR.
Referenced by Init_File().
Definition at line 5404 of file file.c.
References get_stat(), getuid(), Qfalse, Qtrue, rb_group_member(), rb_stat_rowned(), S_IXGRP, S_IXOTH, S_IXUGO, and S_IXUSR.
Referenced by Init_File().
Definition at line 5457 of file file.c.
References get_stat(), Qfalse, and Qtrue.
Referenced by Init_File().
Definition at line 223 of file file.c.
References gzfile::enc, ENCINDEX_ASCII, ENCINDEX_UTF_8, ENCODING_GET, FALSE, len, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, NULL, gzfile::path, rb_enc_associate(), rb_enc_from_index(), rb_enc_mbc_to_codepoint, rb_enc_precise_mbclen(), rb_filesystem_encindex(), rb_str_buf_new(), rb_str_cat(), rb_str_conv_enc(), rb_str_modify_expand(), rb_str_set_len(), rb_utf8_encoding(), RSTRING_LEN, and RSTRING_PTR.
Referenced by apply2files(), argf_next_argv(), check_dirname(), dir_initialize(), dir_s_chdir(), do_opendir(), join_path(), load_file(), push_glob(), rb_dir_s_empty_p(), rb_execarg_addopt(), rb_execarg_parent_start1(), rb_f_load(), rb_file_chmod(), rb_file_chown(), rb_file_executable_p(), rb_file_executable_real_p(), rb_file_expand_path_internal(), rb_file_grpowned_p(), rb_file_lstat(), rb_file_readable_p(), rb_file_readable_real_p(), rb_file_s_ftype(), rb_file_s_join(), rb_file_s_lstat(), rb_file_s_rename(), rb_file_symlink_p(), rb_file_writable_p(), rb_file_writable_real_p(), rb_io_reopen(), rb_require_internal(), rb_stat(), rb_stat_init(), rb_stat_sticky(), rb_sysopen(), realpath_rec(), and syserr_fail2_in().
|
static |
Definition at line 4586 of file file.c.
References errno, and flock().
Referenced by rb_file_flock().
|
static |
Definition at line 3761 of file file.c.
References CONST_ID, ELOOP, errno, ID2SYM, isdirsep, len, link(), lstat, NIL_P, Qnil, rb_enc_check(), rb_enc_get(), rb_enc_left_char_head, rb_enc_path_next(), RB_GC_GUARD, rb_hash_aref(), rb_hash_aset(), rb_readlink(), rb_realpath_internal(), 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_syserr_fail_path, RSTRING_LEN, RSTRING_PTR, S_ISLNK, skipprefixroot(), stat, strlen(), and strrdirsep.
Referenced by rb_realpath_internal().
|
static |
Definition at line 3998 of file file.c.
References fncomp, last, 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 4034 of file file.c.
References chompdirsep(), f, Inc, isdirsep, name, skipprefix, strlen(), and strrdirsep.
Referenced by rb_file_s_basename().
const char* ruby_enc_find_extname | ( | const char * | name, |
long * | len, | ||
rb_encoding * | enc | ||
) |
Definition at line 4232 of file file.c.
References Inc, isADS, isdirsep, istrailinggarbage, last, len, name, strlen(), and strrdirsep.
Referenced by path_sub_ext(), and rb_file_s_extname().
int ruby_is_fd_loadable | ( | int | fd | ) |
Definition at line 5697 of file file.c.
References errno, fstat, S_ISDIR, and S_ISREG.
Referenced by open_load_file(), and rb_file_load_ok().
|
inlinestatic |
Definition at line 3055 of file file.c.
References isdirsep, skipprefix, and skiproot().
Referenced by rb_realpath_internal(), and realpath_rec().
|
inlinestatic |
Definition at line 3009 of file file.c.
References isdirsep.
Referenced by rb_file_dirname(), rb_file_expand_path_internal(), and skipprefixroot().
Definition at line 777 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().
Definition at line 760 of file file.c.
References timespec::tv_nsec, and timespec::tv_sec.
Referenced by stat_atime().
Definition at line 825 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().
Definition at line 808 of file file.c.
References timespec::tv_nsec, and timespec::tv_sec.
Referenced by stat_ctime().
|
static |
Definition at line 801 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().
Definition at line 784 of file file.c.
References timespec::tv_nsec, and timespec::tv_sec.
Referenced by rb_f_test(), rb_stat_cmp(), and stat_mtime().
Definition at line 402 of file file.c.
References ALLOC, RTYPEDDATA_DATA, stat, and TypedData_Wrap_Struct.
Referenced by rb_stat_new(), and rb_stat_s_alloc().
Definition at line 3666 of file file.c.
References rb_str_resize(), and RSTRING_LEN.
Referenced by copy_path_class().
Definition at line 2669 of file file.c.
References FilePathValue, INT2FIX, link(), MAXPATHLEN, rb_file_s_link, rb_str_append(), rb_str_cat2(), rb_str_ellipsize(), rb_str_encode_ospath(), rb_str_new_cstr(), rb_syserr_fail_path, StringValueCStr, and sys_fail2.
|
static |
Definition at line 4690 of file file.c.
References FilePathValue, rb_check_arity, RB_TYPE_P, and T_FILE.
|
inlinestatic |
Definition at line 2400 of file file.c.
References NIL_P, and NUM2GIDT.
Referenced by rb_file_chown(), and rb_file_s_chown().
|
inlinestatic |
Definition at line 2391 of file file.c.
References NIL_P, and NUM2UIDT.
Referenced by rb_file_chown(), and rb_file_s_chown().
Definition at line 2806 of file file.c.
References rb_sys_fail_path.
Referenced by rb_file_s_unlink().
Definition at line 2613 of file file.c.
References utimbuf::actime, utime_args::atime, utimbuf::modtime, utime_args::mtime, NULL, utime_args::tsp, timespec::tv_sec, utime(), and utime_failed.
Referenced by rb_file_s_utime().
VALUE rb_cFile |
Definition at line 129 of file file.c.
Referenced by argf_next_argv(), console_dev(), copy_stream_body(), define_filetest_function(), Init_Dir(), Init_File(), 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_exists_p(), rb_file_open(), rb_file_open_str(), rb_io_fdopen(), rb_io_open_generic(), rb_io_open_with_args(), and unlink_rescue().
VALUE rb_cStat |
Definition at line 131 of file file.c.
Referenced by Init_File(), and rb_stat_new().
VALUE rb_mFileTest |
Definition at line 130 of file file.c.
Referenced by define_filetest_function(), Init_File(), path_blockdev_p(), path_chardev_p(), path_directory_p(), path_empty_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(), path_zero_p(), and rb_file_exists_p().
|
static |
Definition at line 4360 of file file.c.
Referenced by chunk_ii().
|
static |