aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
* * file.c (rb_file_truncate): fix function.nobu2011-04-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_group_member): kill 256K of stack usage.kosaki2011-04-111-5/+11
| | | | | | | | the patch was written by Eric Wong. [ruby-core:35699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_flock): use rb_thread_io_blocking_region for thenobu2011-02-201-1/+1
| | | | | | time being. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (w32_io_info): get rid of too huge alloca().kosaki2011-01-271-1/+4
| | | | | | | | [Bug #4313] [ruby-core:34830] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): get rid of warnings caused bynobu2010-12-261-5/+10
| | | | | | -Wdeclaration-after-statement on cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: parenthesize macro arguments.akr2010-12-131-22/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typoskazu2010-12-061-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NTFS's ctime is creation time! [ruby-core:33269]naruse2010-11-201-0/+6
| | | | | | Note that UFS2, HFS+, ZFS, and ext4 also have birth time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): use cygwin_conv_path on cygwin 1.7 ornobu2010-11-111-8/+29
| | | | | | | later. * ruby.c (push_include_cygwin): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (NUM2DEVT, DEVT2NUM, PRI_DEVT_PREFIX): fallback tonobu2010-10-151-0/+10
| | | | | | unsigned int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (dev_t): use RUBY_REPLACE_TYPE.nobu2010-10-151-10/+2
| | | | | | * file.c (rb_stat_inspect): use PRI_DEVT_PREFIX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Refix for r29493; it is unsigned.naruse2010-10-141-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (DEVT2NUM): added. Size of dev_t is depend on thenaruse2010-10-131-5/+11
| | | | | | | | | | | | | | | | | | environment even if POSIX defines dev_t as unsigned integer. For example, OpenVMS, 64bit Solaris 9, and NetBSD 6 defines dev_t as 64bit unsigned integer. * file.c (rb_stat_dev): use DEVT2NUM. * file.c (rb_stat_dev_major): dev_t is not long. major(3)'s return value is int. * file.c (rb_stat_dev_minor): dev_t is not long. minor(3)'s return value is int. * configure.in: check size of dev_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_readlink): symlink target should be innobu2010-09-041-1/+1
| | | | | | filesystem encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_get_path_check): clarify error message fornobu2010-08-291-2/+7
| | | | | | | | ASCII-incompatible path name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (null_device): move from io.c.nobu2010-08-271-0/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (realpath_rec): rb_str_modify depends on the length, sonobu2010-08-061-2/+1
| | | | | | resize instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (realpath_rec): call rb_str_modify before rb_str_set_len.akr2010-08-041-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): wrong condition. [ruby-core:31591]usa2010-08-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): suppress a warning.nobu2010-07-301-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): home directory must be absolute.nobu2010-07-291-4/+14
| | | | | | | [ruby-core:31537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): should check if could find user.nobu2010-07-291-1/+3
| | | | | | | [ruby-core:31538] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_basename): pass baselen to rmext.nobu2010-07-281-6/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:naruse2010-07-271-1/+1
| | | | | | | | clean unused-value warnings. * cont.c, process.c, vm_exec.h: clean cast warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu2010-07-181-1/+1
| | | | | | | | add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (ruby_find_basename): set correct baselen.usa2010-07-071-6/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (ruby_find_basename): should initialize f.usa2010-07-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_inplace_mode_set): prohibits an assignment of a taintedusa2010-07-021-50/+101
| | | | | | | | | | | | | | value. * file.c (ruby_find_basename, ruby_find_extname): split from rb_file_s_basename() and rb_file_s_extname(). * util.c (ruby_add_suffix): support arbitrary length of the suffix to get rid of the potential buffer overflow. reported by tarui. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_realpath_internal, realpath_rec): skip UNC share rootusa2010-06-291-4/+16
| | | | | | | | on DOSISH platforms. http://pc12.2ch.net/test/read.cgi/tech/1272248179/600 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_str_encode_ospath): when the encoding of the parameterusa2010-06-171-6/+12
| | | | | | | | | | | | | | | | | is ASCII-8BIT, should recognize as filesystem encoding, and convert to UTF-8 on Windows. * file.c (realpath_rec): should convert to ospath encoding before calling lstat(). * file.c (rb_realpath_internal): resolved string should take over the encoding of base string. * transcode.c (rb_str_encode): should return new string always. fixed #3444. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): 'W' should test writable by real uid/git,nobu2010-06-041-1/+1
| | | | | | | not world writable. [ruby-core:30587] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): Refix r28102: this breaksnaruse2010-05-311-2/+3
| | | | | | r28039. test for [ruby-dev:41429] is added. [ruby-core:30516] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): check if expanded dname encoding isnobu2010-05-301-2/+2
| | | | | | | | | | compatible with fname, not just copying. [ruby-core:30516] * test/ruby/test_beginendblock.rb (test_endblockwarn): needs encoding comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_directory_p): update rdoc. a patch from Ilkkamame2010-05-301-11/+2
| | | | | | Laukkanen. [ruby-core:30016] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed trailing spaces.nobu2010-05-291-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_home_dir): set filesystem encoding.naruse2010-05-271-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): set encoding as the same of fnamenaruse2010-05-271-0/+2
| | | | | | when _result_ is not filesystem encoding. [ruby-dev:41429] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): use rb_enc_associate_index andnaruse2010-05-271-7/+2
| | | | | | | | | rb_filesystem_encindex. Strings related FileSystem should have filesystem_encoding. * file.c (SET_EXTERNAL_ENCODING): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): revert a part of r22392. it's commit miss.usa2010-05-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c: Documentation: small fixesmarcandre2010-05-171-3/+3
| | | | | | | | * file.c: ditto * io.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-111/+111
| | | | | | | | | | | | | | * enum.c: Documentation: whitespace fix for r27865 * error.c: ditto * file.c: ditto * io.c: ditto * load.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-101/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat): use STAT macro instead of calling stat() directly.usa2010-05-051-1/+1
| | | | | | | reported by Bill Kelly. [ruby-core:30012] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_str_encode_ospath): unused variable.nobu2010-05-031-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * merge some patches from win32-uncode-test branch.usa2010-04-301-28/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | see #1685. * file.c, include/ruby/intern.h (rb_str_encode_ospath): new function to convert encoding for pathname. * win32.c, include/ruby/win32.h (rb_w32_ulink, rb_w32_urename, rb_w32_ustati64, rb_w32_uopen, rb_w32_uutime, rb_w32_uchdir, rb_w32_umkdir, rb_w32_urmdir, rb_w32_uunlink): new functions to accept UTF-8 path. * win32/win32.c (rb_w32_opendir, link, rb_w32_stati64, rb_w32_utime, rb_w32_unlink): use WCHAR path internally. * file.c (rb_stat, eaccess, access_internal, rb_file_s_ftype, chmod_internal, rb_file_chmod, rb_file_chown, utime_internal, rb_file_s_link, unlink_internal, rb_file_s_rename): use UTF-8 version functions on Win32. * file.c (apply2files, rb_stat, rb_file_s_lstat, rb_file_symlink_p, rb_file_readable_p, rb_file_writable_p, rb_file_executable_p, check3rdbyte, rb_file_identical_p, rb_file_chmod, rb_file_chown, rb_file_s_link, rb_file_s_symlink, rb_file_s_rename): call rb_str_encode_ospath() before passing the path to system. * io.c (rb_sysopen): ditto. * dir.c (dir_chdir, dir_s_mkdir, dir_s_rmdir): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): call rb_str_set_len before BUFCHECK toakr2010-04-301-0/+4
| | | | | | | prevent rb_str_resize in BUFCHECK discard the content. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrongmarcandre2010-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | number of arguments * file.c (rb_f_test, rb_file_s_umask): ditto * numeric.c (int_chr, num_step): ditto * process.c (rb_f_sleep): ditto * re.c (rb_reg_initialize_m): ditto * signal.c (rb_f_kill, sig_trap): ditto * string.c (rb_str_aref_m, rb_str_aset_m, rb_str_count, rb_str_delete_bang, rb_str_slice_bang, rb_str_sub_bang, str_gsub): ditto * proc.c (curry): rdoc fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 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