4static VALUE rb_cPathname;
12static ID id_birthtime;
13static ID id_blockdev_p;
14static ID id_chardev_p;
18static ID id_directory_p;
22static ID id_executable_p;
23static ID id_executable_real_p;
25static ID id_expand_path;
33static ID id_grpowned_p;
44static ID id_readable_p;
45static ID id_readable_real_p;
46static ID id_readlines;
48static ID id_realdirpath;
62static ID id_symlink_p;
68static ID id_world_readable_p;
69static ID id_world_writable_p;
70static ID id_writable_p;
71static ID id_writable_real_p;
112 set_strpath(self,
str);
125path_freeze(
VALUE self)
139path_taint(
VALUE self)
141 rb_warn(
"Pathname#taint is deprecated and will be removed in Ruby 3.2.");
152path_untaint(
VALUE self)
154 rb_warn(
"Pathname#untaint is deprecated and will be removed in Ruby 3.2.");
168 return rb_str_equal(get_strpath(self), get_strpath(other));
193 s1 = get_strpath(self);
194 s2 = get_strpath(other);
199 while (p1 < e1 && p2 < e2) {
201 c1 = (
unsigned char)*p1++;
202 c2 = (
unsigned char)*p2++;
203 if (c1 ==
'/') c1 =
'\0';
204 if (c2 ==
'/') c2 =
'\0';
220#define ST2FIX(h) LONG2FIX((long)(h))
247path_inspect(
VALUE self)
299 else if (extlen <= 1) {
360 args[0] = get_strpath(self);
386 args[0] = get_strpath(self);
406 args[0] = get_strpath(self);
427 args[0] = get_strpath(self);
448 args[0] = get_strpath(self);
470 args[0] = get_strpath(self);
488 args[0] = get_strpath(self);
502path_atime(
VALUE self)
507#if defined(HAVE_RB_FILE_S_BIRTHTIME)
524# define path_birthtime rb_f_notimplement
536path_ctime(
VALUE self)
550path_mtime(
VALUE self)
624 VALUE pattern, flags;
640path_ftype(
VALUE self)
677 args[0] = get_strpath(self);
693path_readlink(
VALUE self)
726path_lstat(
VALUE self)
790path_dirname(
VALUE self)
803path_extname(
VALUE self)
832path_split(
VALUE self)
835 VALUE ary, dirname, basename;
849path_blockdev_p(
VALUE self)
858path_chardev_p(
VALUE self)
867path_executable_p(
VALUE self)
876path_executable_real_p(
VALUE self)
885path_exist_p(
VALUE self)
894path_grpowned_p(
VALUE self)
903path_directory_p(
VALUE self)
912path_file_p(
VALUE self)
921path_pipe_p(
VALUE self)
930path_socket_p(
VALUE self)
939path_owned_p(
VALUE self)
948path_readable_p(
VALUE self)
957path_world_readable_p(
VALUE self)
966path_readable_real_p(
VALUE self)
975path_setuid_p(
VALUE self)
984path_setgid_p(
VALUE self)
1002path_size_p(
VALUE self)
1011path_sticky_p(
VALUE self)
1020path_symlink_p(
VALUE self)
1029path_writable_p(
VALUE self)
1038path_world_writable_p(
VALUE self)
1047path_writable_real_p(
VALUE self)
1056path_zero_p(
VALUE self)
1067path_empty_p(
VALUE self)
1070 VALUE path = get_strpath(self);
1172path_s_getwd(
VALUE klass)
1206path_entries(
VALUE self)
1211 str = get_strpath(self);
1244path_rmdir(
VALUE self)
1255path_opendir(
VALUE self)
1259 args[0] = get_strpath(self);
1274path_each_entry(
VALUE self)
1278 args[0] = get_strpath(self);
1299path_unlink(
VALUE self)
1515#ifdef HAVE_RB_EXT_RACTOR_SAFE
1573 rb_define_method(rb_cPathname,
"executable_real?", path_executable_real_p, 0);
1582 rb_define_method(rb_cPathname,
"world_readable?", path_world_readable_p, 0);
1591 rb_define_method(rb_cPathname,
"world_writable?", path_world_writable_p, 0);
1628 id_directory_p =
rb_intern(
"directory?");
1632 id_executable_p =
rb_intern(
"executable?");
1633 id_executable_real_p =
rb_intern(
"executable_real?");
1635 id_expand_path =
rb_intern(
"expand_path");
1655 id_readable_real_p =
rb_intern(
"readable_real?");
1658 id_realdirpath =
rb_intern(
"realdirpath");
1677 id_world_readable_p =
rb_intern(
"world_readable?");
1678 id_world_writable_p =
rb_intern(
"world_writable?");
1680 id_writable_real_p =
rb_intern(
"writable_real?");
void rb_ary_store(VALUE ary, long idx, VALUE val)
VALUE rb_check_array_type(VALUE ary)
VALUE rb_ary_entry(VALUE ary, long offset)
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
#define rb_define_singleton_method(klass, mid, func, arity)
Defines klass.mid.
#define rb_define_global_function(mid, func, arity)
Defines rb_mKernel #mid.
rb_encoding * rb_enc_get(VALUE obj)
char str[HTML_ESCAPE_MAX_LEN+1]
#define RSTRING_LEN(string)
#define RSTRING_PTR(string)
const char * ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
void rb_undef_method(VALUE klass, const char *name)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
int rb_block_given_p(void)
Determines if the current method is given a block.
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_rescue2(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2,...)
An equivalent of rescue clause.
void rb_warn(const char *fmt,...)
VALUE rb_convert_type(VALUE, int, const char *, const char *)
Converts an object into another type.
VALUE rb_cObject
Object class.
VALUE rb_class_new_instance(int, const VALUE *, VALUE)
Allocates and initializes an instance of klass.
VALUE rb_obj_class(VALUE)
VALUE rb_obj_dup(VALUE)
Equivalent to Object#dup in Ruby.
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
VALUE rb_funcallv_kw(VALUE, ID, int, const VALUE *, int)
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
VALUE rb_call_super(int, const VALUE *)
void rb_ext_ractor_safe(bool flag)
VALUE rb_str_freeze(VALUE)
VALUE rb_str_equal(VALUE str1, VALUE str2)
VALUE rb_str_subseq(VALUE, long, long)
VALUE rb_str_append(VALUE, VALUE)
st_index_t rb_str_hash(VALUE)
VALUE rb_ivar_get(VALUE, ID)
VALUE rb_const_get_at(VALUE, ID)
VALUE rb_ivar_set(VALUE, ID, VALUE)
VALUE rb_check_funcall(VALUE, ID, int, const VALUE *)
ID rb_intern(const char *)
#define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg)
VALUE rb_block_call_kw(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE, int)
VALUE rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
Call a method with a block.
void InitVM_pathname(void)
#define RARRAY_AREF(a, i)
const char * rb_obj_classname(VALUE)
#define RB_PASS_CALLED_KEYWORDS
VALUE rb_sprintf(const char *,...)