|
Ruby
2.7.2p137(2020-10-01revision5445e0435260b449decf2ac16f9d09bae3cafe72)
|
#include "id.h"#include "ruby/encoding.h"#include "ruby/io.h"#include "ruby/util.h"#include "ruby/thread.h"#include "internal.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 | apply_filename |
| struct | apply_arg |
| struct | no_gvl_stat_data |
| struct | access_arg |
| struct | chown_args |
| struct | utime_args |
| struct | utimbuf |
| struct | rename_args |
Macros | |
| #define | MAXPATHLEN 1024 |
| #define | lstat stat |
| #define | STAT(p, s) stat((p), (s)) |
| #define | USE_OSPATH 0 |
| #define | TO_OSPATH(str) (str) |
| #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 | statx_has_birthtime(st) 0 |
| #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 | rb_file_s_lutime rb_f_notimplement |
| #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 |
Typedefs | |
| typedef struct no_gvl_stat_data | no_gvl_stat_data |
Enumerations | |
| enum | rb_realpath_mode { RB_REALPATH_CHECK, RB_REALPATH_DIR, RB_REALPATH_STRICT, RB_REALPATH_MODE_MAX } |
Variables | |
| VALUE | rb_cFile |
| VALUE | rb_mFileTest |
| VALUE | rb_cStat |
| const char | ruby_null_device [] |
| #define apply2args | ( | n | ) | (rb_check_arity(argc, n, UNLIMITED_ARGUMENTS), argc-=n) |
| #define BUFCHECK | ( | cond | ) |
| #define BUFCOPY | ( | srcptr, | |
| srclen | |||
| ) |
| #define BUFINIT | ( | ) |
| #define check_expand_path_args | ( | fname, | |
| dname | |||
| ) |
| #define endpwent | ( | ) | ((void)0) |
| #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 EXPAND_PATH_BUFFER | ( | ) | rb_usascii_str_new(0, MAXPATHLEN + 2) |
| #define fncomp strncmp |
| #define Next | ( | p, | |
| e, | |||
| enc | |||
| ) | ((p) + rb_enc_mbclen((p), (e), (enc))) |
| #define nextdirsep rb_enc_path_next |
| #define O_BINARY 0 |
| #define O_SHARE_DELETE 0 |
| #define rb_file_birthtime rb_f_notimplement |
| #define rb_file_s_birthtime rb_f_notimplement |
| #define rb_file_s_lchmod rb_f_notimplement |
| #define rb_file_s_lchown rb_f_notimplement |
| #define rb_file_s_link rb_f_notimplement |
| #define rb_file_s_lutime rb_f_notimplement |
| #define rb_file_s_mkfifo rb_f_notimplement |
| #define rb_file_s_readlink rb_f_notimplement |
| #define rb_file_s_symlink rb_f_notimplement |
| #define rb_file_s_truncate rb_f_notimplement |
| #define rb_file_truncate rb_f_notimplement |
| #define rb_stat_birthtime rb_f_notimplement |
| #define S_ISBLK | ( | m | ) | (0) /* anytime false */ |
| #define S_ISCHR | ( | m | ) | (((m) & S_IFMT) == S_IFCHR) |
| #define S_ISDIR | ( | m | ) | (((m) & S_IFMT) == S_IFDIR) |
| #define S_IWOTH 002 |
| #define ST2UINT | ( | val | ) | ((val) & ~(~1UL << (sizeof(val) * CHAR_BIT - 1))) |
| #define strrdirsep rb_enc_path_last_separator |
| #define syserr_fail2_in | ( | func, | |
| e, | |||
| s1, | |||
| s2 | |||
| ) | syserr_fail2(e, s1, s2) |
| #define WITH_ROOTDIFF | ( | stmt | ) |
| typedef struct no_gvl_stat_data no_gvl_stat_data |
| enum rb_realpath_mode |
| int eaccess | ( | const char * | path, |
| int | mode | ||
| ) |
| void Init_File | ( | void | ) |
Definition at line 6435 of file file.c.
References rb_cFile, rb_cIO, rb_define_class(), rb_define_module(), and rb_mFileTest.
| NORETURN | ( | static void | syserr_fail2_inconst char *, int, VALUE, VALUE | ) |
| VALUE rb_check_realpath | ( | VALUE | basedir, |
| VALUE | path, | ||
| rb_encoding * | enc | ||
| ) |
| char* rb_enc_path_end | ( | const char * | path, |
| const char * | end, | ||
| rb_encoding * | enc | ||
| ) |
| 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 3358 of file file.c.
Referenced by rb_enc_path_skip_prefix().
| char* rb_enc_path_skip_prefix | ( | const char * | path, |
| const char * | end, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 3372 of file file.c.
References isdirsep, and rb_enc_path_next().
Definition at line 4072 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 6083 of file file.c.
References rb_define_const().
Definition at line 4645 of file file.c.
References FilePathStringValue, name, rb_enc_get(), RSTRING_LEN, and StringValueCStr.
Referenced by rb_f_require_relative().
Definition at line 4018 of file file.c.
References check_expand_path_args, expand_path, and EXPAND_PATH_BUFFER.
Referenced by rb_file_s_expand_path().
Definition at line 4025 of file file.c.
References expand_path, and EXPAND_PATH_BUFFER.
Referenced by rb_feature_provided().
Definition at line 4079 of file file.c.
References argc, argv, Qnil, rb_check_arity, and rb_file_absolute_path().
Definition at line 4031 of file file.c.
References argc, argv, Qnil, rb_check_arity, and rb_file_expand_path().
Definition at line 6336 of file file.c.
References f, and StringValueCStr.
Referenced by rb_find_file_safe(), and rb_load().
Definition at line 6270 of file file.c.
References f, and StringValueCStr.
Referenced by rb_find_file_ext_safe().
Definition at line 6263 of file file.c.
References rb_find_file_ext(), and rb_warn().
Definition at line 6329 of file file.c.
References rb_find_file(), and rb_warn().
Definition at line 230 of file file.c.
References rb_get_path_check_convert(), and rb_get_path_check_to_string().
Referenced by rb_feature_provided(), rb_get_path_no_checksafe(), and rb_resolve_feature_path().
Definition at line 211 of file file.c.
Referenced by rb_get_path().
Definition at line 196 of file file.c.
References CONST_ID, rb_check_funcall_default(), RB_TYPE_P, StringValue, and T_STRING.
Referenced by rb_get_path().
Definition at line 224 of file file.c.
References rb_get_path().
| int rb_is_absolute_path | ( | const char * | path | ) |
| int rb_path_check | ( | const char * | path | ) |
Definition at line 6168 of file file.c.
References PATH_SEP_CHAR, strchr(), and strlen().
Definition at line 4409 of file file.c.
References RB_REALPATH_DIR, and RB_REALPATH_STRICT.
Definition at line 236 of file file.c.
References gzfile::enc, ENCINDEX_ASCII, ENCINDEX_UTF_8, ENCODING_GET, gzfile::path, rb_enc_from_index(), rb_filesystem_encindex(), rb_str_conv_enc(), and rb_utf8_encoding().
Referenced by rb_resolve_feature_path().
| const char* ruby_enc_find_basename | ( | const char * | name, |
| long * | baselen, | ||
| long * | alllen, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 4502 of file file.c.
References f, isdirsep, name, skipprefix, strlen(), and strrdirsep.
| const char* ruby_enc_find_extname | ( | const char * | name, |
| long * | len, | ||
| rb_encoding * | enc | ||
| ) |
| int ruby_is_fd_loadable | ( | int | fd | ) |
| VALUE rb_cFile |
Definition at line 159 of file file.c.
Referenced by Init_File(), and rb_io_fdopen().
| VALUE rb_mFileTest |
Definition at line 160 of file file.c.
Referenced by Init_File().