aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
* * file.c (rb_file_s_extname): skip last directory separators.nobu2010-04-191-1/+1
| | | | | | | [ruby-core:29627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_dirname): split from rb_file_s_dirname.nobu2010-03-301-1/+7
| | | | | | | * load.c (rb_f_require_relative): use absolute path instead of expanded path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_get_path_check): prefer #to_path over #to_str. a patchmame2010-03-251-7/+3
| | | | | | | originally written by me, and modified by Nobuyoshi Nakada. [ruby-core:24257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): set length of string before callingnaruse2010-03-241-2/+5
| | | | | | | rb_enc_check because rb_enc_check scans its content. This prevents warnings by valgrind. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolutemame2010-03-161-5/+5
| | | | | | | | | | | | | | | path field into rb_iseq_t. The field contains a string representing a path to corresponding source file. or nil when the iseq is created from -e, stdin, eval, etc. This field is used for require_relative. [ruby-dev:40004] * load.c (rb_f_require_relative): add C implementation of require_relative. * prelude.rb (require_relative): get rid of Ruby implementation of require_relative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): ignore dname if it has differentnobu2010-03-161-1/+20
| | | | | | drive letter or UNC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (Init_File): do not define File::ALT_SEPARATOR on cygwin.nobu2010-03-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (realpath_rec): use same cache.nobu2010-03-141-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_alt_separator): commit miss.nobu2010-03-141-5/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (FILE_ALT_SEPARATOR): separated condition.nobu2010-03-141-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (EXPAND_PATH_BUFFER): make it back to usascii, to preventmatz2010-03-131-1/+1
| | | | | | infinite loop on some platform. [ruby-dev:40629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): should not just copy the encodingmatz2010-03-131-2/+2
| | | | | | | | | from fname. [ruby-core:28635] * file.c (EXPAND_PATH_BUFFER): set filesystem_encoding, not usascii for path buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * load.c (rb_get_expanded_load_path): does not expand paths if allshugo2010-03-131-8/+6
| | | | | | the items in $: are absolute paths. [ruby-core:28113] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_basename): check encoding of suffix.nobu2010-03-121-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: add optional basedir argument for realpath/realdirpath.akr2010-03-071-24/+64
| | | | | | | | | | | | | (realpath_internal): handle basedir. (rb_file_s_realpath): extract basedir from argument list. (rb_file_s_realdirpath): extract basedir from argument list. * lib/pathname.rb (realpath): pass basedir. (realdirpath): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_set_filesystem_encoding):naruse2010-03-061-11/+0
| | | | | | | | | | filesystem encoding on Mac OS X is now default external encoding. so Mac OS X is now treated as one of Unix. [ruby-dev:40439] * file.c (file_path_convert): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file_ext_safe, rb_find_file_safe): skip argumentnobu2010-03-021-7/+20
| | | | | | | checks in file_expand_path(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_group_member): renamed from group_member.akr2010-02-161-9/+7
| | | | | | | | don't use group_member() in glibc because it's not valgrind clean. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570047 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (realpath_rec): rb_path_last_separator may return NULL.akr2010-02-031-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (be_chown, be_fchown, eaccess): suppressed warnings.nobu2010-01-251-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c, file.c, io.c, signal.c: add __HAIKU__.naruse2010-01-251-2/+2
| | | | | | patched by Alexander von Gluck [ruby-core:27767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_set_len): call rb_str_modify.akr2010-01-121-1/+0
| | | | | | | | * file.c (realpath_rec): don't call rb_str_modify before rb_str_set_len. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (realpath_internal): call rb_secure.akr2010-01-121-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (realpath_rec): trace symbolic link only when supportingusa2010-01-121-1/+4
| | | | | | | readline(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prelude.rb (require_relative): use File.realpath. [ruby-dev:40040]akr2010-01-121-0/+141
| | | | | | | | | | | | | | | | | * include/ruby/intern.h: declare rb_dir_getwd. * dir.c (rb_dir_getwd): copied from dir_s_getwd to export. (dir_s_getwd): use rb_dir_getwd. * file.c (rb_file_s_realpath): new method File.realpath. (rb_file_s_realdirpath): new method File.realdirpath. * lib/pathname.rb (Pathname#realpath): use File.realpath. (Pathname#realdirpath): use File.realdirpath. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): use string form in unknown command errorakr2009-12-071-31/+31
| | | | | | | message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_path_convert): fix fs_encoding is not assign.naruse2009-11-241-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_path_convert): delay getting UTF8-MAC encodingnaruse2009-11-211-7/+8
| | | | | | while really needed. [ruby-core:26807] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_path_convert): delay getting filesystem encodingusa2009-11-181-3/+3
| | | | | | | | while really needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_scan_open_args): move path encoding conversionnaruse2009-11-181-0/+29
| | | | | | | | | | | for filesystem encoding of Mac OS X. * file.c (file_path_convert): added for convert encoding of file path. * file.c (rb_get_path_check): add file_path_convert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: rdoc for <=>, casecmpmarcandre2009-10-281-1/+1
| | | | | | | | | | | | * bignum.c: rdoc for <=> * file.c: ditto * time.c: ditto * compar.c: rdoc git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (path_check_0): prevent from GC.nobu2009-10-101-10/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c, include/ruby/win32.h (rb_w32_access): new function tousa2009-09-251-3/+0
| | | | | | | | | | | replace MSVCRT's access(). [ruby-core:25761] * file.c (eaccess): workaround for recent MSVCRT is no longer needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (GlobPathValue), file.c (rb_get_path_check): path namesnobu2009-09-191-0/+1
| | | | | | | must be ASCII compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (stat_data_type): typed.nobu2009-09-091-3/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_basename): returns new string instead ofnobu2009-07-081-2/+2
| | | | | | | shared string from FilePathStringValue(). [ruby-core:24199] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (BUFCHECK): use common bdiff.nobu2009-06-291-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): should copy original encoding.nobu2009-06-291-1/+1
| | | | | | | [ruby-dev:38612] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_get_path_check): check with given safe level.nobu2009-06-231-7/+11
| | | | | | | | | * file.c (rb_find_file_ext_safe, rb_find_file_safe): ditto. * safe.c (rb_insecure_operation): function to raise security error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file_ext, rb_find_file): no needs to expandnobu2009-06-231-29/+61
| | | | | | | | | | | | | | | paths with tilde twice. * load.c (rb_f_load): load the given path directly if not found in load_path. * load.c (search_required): search file in specified safe level. * load.c (rb_require_safe): path to load is already searched in search_required(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: remove __CHECKER__ test.akr2009-06-221-3/+1
| | | | | | | | | | | | | | * dir.c: ditto. * dln.c: ditto. * file.c: ditto. * process.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): drive letter is ascii only.nobu2009-06-171-0/+1
| | | | | | | [ruby-dev:38612] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file_ext, rb_find_file): canonicalize absolutenobu2009-06-141-3/+2
| | | | | | | paths. [ruby-core:23845] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_size): added rdoc. a patch from Run Paint Runnobu2009-06-141-0/+10
| | | | | | | Run at [ruby-core:23839]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): associate the input encoding whennobu2009-06-121-0/+1
| | | | | | | copying an absolute path. [ruby-dev:38594] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (istrailinggarbage): fixed typo.nobu2009-05-311-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_join): recursive array has no meaning as pathnobu2009-04-291-2/+5
| | | | | | | name. [ruby-core:23329] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * node.h (rb_notimplement_body_p): declared.akr2009-04-161-27/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_method.c (Init_eval_method): suppress a warning. * io.c (rb_io_fsync): use rb_f_notimplement if not implemented. (rb_io_close_on_exec_p): ditto. (rb_io_set_close_on_exec): ditto. (rb_io_fcntl): ditto. (rb_f_syscall): ditto. * dir.c (dir_tell): ditto. (dir_seek): ditto. (dir_s_chroot): ditto. * process.c (proc_getpgrp): ditto. (proc_setpgrp): ditto. (proc_getpgid): ditto. (proc_setpgid): ditto. (proc_setsid): ditto. (proc_getpriority): ditto. (proc_setpriority): ditto. (proc_getrlimit): ditto. (proc_setrlimit): ditto. (p_sys_setuid): ditto. (p_sys_setruid): ditto. (p_sys_seteuid): ditto. (p_sys_setreuid): ditto. (p_sys_setresuid): ditto. (p_sys_setgid): ditto. (p_sys_setrgid): ditto. (p_sys_setegid): ditto. (p_sys_setregid): ditto. (p_sys_setreuid): ditto. (p_sys_setresgid): ditto. (p_sys_issetugid): ditto. (proc_getgroups): ditto. (proc_setgroups): ditto. (proc_initgroups): ditto. (proc_daemon): ditto. (rb_proc_times): ditto. * file.c (rb_file_s_lchown): ditto. (rb_file_s_link): ditto. (rb_file_s_symlink): ditto. (rb_file_s_readlink): ditto. (rb_file_s_truncate): ditto. (rb_file_truncate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_define_method_id): use rb_define_notimplement_method_idakr2009-04-161-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | if rb_f_notimplement is given. (rb_define_protected_method): ditto. (rb_define_private_method): ditto. (rb_define_method): use rb_define_method_id. * include/ruby/intern.h (rb_f_notimplement): declared. (rb_define_notimplement_method_id): declared. * proc.c (method_inspect): show not-implemented. * vm_method.c (notimplement_body): new variable. (rb_notimplement_body_p): new function. (rb_method_boundp): return false if not implemented. (rb_f_notimplement): new function. (rb_define_notimplement_method_id): new function. * process.c (rb_f_fork): use rb_f_notimplement if not implemented. * file.c (rb_file_s_lchmod): use rb_f_notimplement if not implemented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e