Ruby: internal/file.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Functions | Variables
file.h File Reference

Internal header for File. More...

`#include "ruby/ruby.h"`
`#include "ruby/encoding.h"`

Go to the source code of this file.

## Functions
VALUE | rb_home_dir_of (VALUE user, VALUE result)
VALUE | rb_default_home_dir (VALUE result)
VALUE | rb_realpath_internal (VALUE basedir, VALUE path, int strict)
VALUE | rb_check_realpath (VALUE basedir, VALUE path, rb_encoding *origenc)
void | rb_file_const (const char *, VALUE)
int | rb_file_load_ok (const char *)
VALUE | rb_file_expand_path_fast (VALUE, VALUE)
VALUE | rb_file_expand_path_internal (VALUE, VALUE, int, int, VALUE)
VALUE | rb_get_path_check_to_string (VALUE)
VALUE | rb_get_path_check_convert (VALUE)
int | ruby_is_fd_loadable (int fd)

## Variables
const char | ruby_null_device []

## Detailed Description

Internal header for File.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Definition in file file.h.

## Function Documentation

## ◆ rb_check_realpath()

VALUE rb_check_realpath | ( | VALUE | basedir,
|  | VALUE | path,
|  | rb_encoding * | origenc
| ) |  |

Definition at line 4504 of file file.c.

References RB_REALPATH_CHECK.

## ◆ rb_default_home_dir()

VALUE rb_default_home_dir | ( | VALUE | result | ) |

Definition at line 3640 of file file.c.

References getenv, getuid(), NIL_P, rb_eArgError, rb_filesystem_encoding(), rb_raise(), rb_str_resize(), rb_w32_filecp(), rb_w32_home_dir(), RSTRING_PTR, and xfree.

Referenced by rb_file_expand_path_internal().

## ◆ rb_file_const()

void rb_file_const | ( | const char * | name,
|  | VALUE | value
| ) |  |

Definition at line 6171 of file file.c.

References name, and rb_define_const().

Referenced by Init_Dir().

## ◆ rb_file_expand_path_fast()

VALUE rb_file_expand_path_fast | ( | VALUE | fname,
|  | VALUE | dname
| ) |  |

Definition at line 4110 of file file.c.

References expand_path, and EXPAND_PATH_BUFFER.

Referenced by rb_feature_provided().

## ◆ rb_file_expand_path_internal()

VALUE rb_file_expand_path_internal | ( | VALUE | fname,
|  | VALUE | dname,
|  | int | abs_mode,
|  | int | long_name,
|  | VALUE | result
| ) |  |

Definition at line 3731 of file file.c.

References ALLOC_N, ALLOCA_N, ALLOCV_END, ALLOCV_N, BUFCHECK, BUFCOPY, BUFINIT, ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAR, ENCINDEX_UTF_8, ENCODING_GET, fix_string_encoding, free, Inc, int(), INVALID_CODE_PAGE, INVALID_HANDLE_VALUE, IS_DIR_SEPARATOR_P, IS_DIR_UNC_P, isADS, isdirsep, istrailinggarbage, L, len, MAXPATHLEN, mbstr_to_wstr, memcpy, nextdirsep, NIL_P, NULL, OBJ_TAINT, OBJ_TAINTED, PATH_BUFFER_SIZE, PRIsVALUE, Qnil, rb_default_home_dir(), rb_eArgError, rb_enc_associate(), rb_enc_check(), rb_enc_copy(), rb_enc_get(), rb_enc_raise, rb_enc_str_asciionly_p(), rb_enc_str_coderange(), rb_eRangeError, rb_exc_new_str(), rb_exc_raise(), rb_file_expand_path_internal(), rb_filesystem_encoding(), rb_home_dir_of(), rb_is_absolute_path(), rb_raise(), rb_str_cat_conv_enc_opts(), rb_str_encode_ospath(), rb_str_modify_expand(), rb_str_new_cstr, rb_str_resize(), rb_str_set_len(), rb_utf8_encoding(), rb_w32_home_dir(), root, RSTRING_LEN, RSTRING_PTR, ruby_getcwd(), S_ISLNK, skipprefix, stat, STRCASECMP, StringValuePtr, strlcat(), strlen(), strncasecmp, strrdirsep, TOLOWER, WITH_ROOTDIFF, and xfree.

Referenced by rb_file_expand_path_internal(), rb_find_file(), and rb_find_file_ext().

## ◆ rb_file_load_ok()

int rb_file_load_ok | ( | const char * | path | ) |

Definition at line 6304 of file file.c.

References free, INVALID_FILE_ATTRIBUTES, INVALID_HANDLE_VALUE, len, mbstr_to_wstr, NULL, O_NONBLOCK, rb_cloexec_open(), rb_update_max_fd(), and ruby_is_fd_loadable().

Referenced by rb_find_file(), and rb_find_file_ext().

## ◆ rb_get_path_check_convert()

VALUE rb_get_path_check_convert | ( | VALUE | obj | ) |

Definition at line 226 of file file.c.

References rb_eArgError, rb_raise(), rb_str_new4, and rb_str_to_cstr().

Referenced by rb_get_path().

## ◆ rb_get_path_check_to_string()

VALUE rb_get_path_check_to_string | ( | VALUE | obj | ) |

Definition at line 211 of file file.c.

References CONST_ID, rb_check_funcall_default(), StringValue, and T_STRING.

Referenced by rb_get_path().

## ◆ rb_home_dir_of()

VALUE rb_home_dir_of | ( | VALUE | user,
|  | VALUE | result
| ) |  |

Definition at line 3600 of file file.c.

References endpwent, getenv, getlogin(), PRIsVALUE, rb_eArgError, rb_enc_get(), rb_filesystem_encoding(), rb_raise(), rb_str_conv_enc(), rb_utf8_encoding(), RSTRING_PTR, and strcasecmp.

Referenced by rb_file_expand_path_internal().

## ◆ rb_realpath_internal()

VALUE rb_realpath_internal | ( | VALUE | basedir,
|  | VALUE | path,
|  | int | strict
| ) |  |

Definition at line 4496 of file file.c.

References rb_enc_get(), RB_REALPATH_DIR, and RB_REALPATH_STRICT.

## ◆ ruby_is_fd_loadable()

int ruby_is_fd_loadable | ( | int | fd | ) |

Definition at line 6277 of file file.c.

References fstat, S_ISCHR, S_ISDIR, S_ISREG, and stat.

Referenced by rb_file_load_ok().

## Variable Documentation

## ◆ ruby_null_device

const char ruby_null_device[]
| extern

Definition at line 6457 of file file.c.

Referenced by Init_File().