aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
* * encoding.c: provide basic features for M17N.matz2007-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y: encoding aware parsing. * parse.y (pragma_encoding): encoding specification pragma. * parse.y (rb_intern3): encoding specified symbols. * string.c (rb_str_length): length based on characters. for older behavior, bytesize method added. * string.c (rb_str_index_m): index based on characters. rindex as well. * string.c (succ_char): encoding aware succeeding string. * string.c (rb_str_reverse): reverse based on characters. * string.c (rb_str_inspect): encoding aware string description. * string.c (rb_str_upcase_bang): encoding aware case conversion. downcase, capitalize, swapcase as well. * string.c (rb_str_tr_bang): tr based on characters. delete, squeeze, tr_s, count as well. * string.c (rb_str_split_m): split based on characters. * string.c (rb_str_each_line): encoding aware each_line. * string.c (rb_str_each_char): added. iteration based on characters. * string.c (rb_str_strip_bang): encoding aware whitespace stripping. lstrip, rstrip as well. * string.c (rb_str_justify): encoding aware justifying (ljust, rjust, center). * string.c (str_encoding): get encoding attribute from a string. * re.c (rb_reg_initialize): encoding aware regular expression * sprintf.c (rb_str_format): formatting (i.e. length count) based on characters. * io.c (rb_io_getc): getc to return one-character string. for older behavior, getbyte method added. * ext/stringio/stringio.c (strio_getc): ditto. * io.c (rb_io_ungetc): allow pushing arbitrary string at the current reading point. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/strscan/strscan.c: encoding support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (group_member): check if presents.nobu2007-08-231-0/+2
| | | | | | | | | | | * configure.in (XCFLAGS): add _GNU_SOURCE on linux. * file.c (group_member): use system routine if available. * process.c: moved _GNU_SOURCE macro to Makefile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_rename): deleted code to get rid of a bug ofnobu2007-07-221-10/+5
| | | | | | | | | | | | | | | | | | | | | | | old Cygwin. * file.c (rb_file_truncate): added prototype of GetLastError() on cygwin. [ruby-dev:31239] * include/ruby/intern.h (is_ruby_native_thread): prototype. * missing/strftime.c (strftime): fix printf format and actual arguments. * ext/Win32API/Win32API.c (Win32API_initialize): ditto. * ext/tk/tcltklib.c (ip_finalize): ditto. * ext/win32ole/win32ole.c (lcid_installed): ditto. * ext/socket/getnameinfo.c: include stdio.h always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby: moved public headers.nobu2007-06-101-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (Init_File): method definition mismatch.nobu2007-05-181-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (Init_File): add to_path method to File objects.matz2007-05-181-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_uid, rb_stat_gid, eaccess): use rb_uid_t andnobu2007-03-041-3/+3
| | | | | | | rb_gid_t instead of int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_s_utime): fixed a commit miss for the platformsnobu2007-03-041-5/+8
| | | | | | | | | where utimes() does not exist. * lib/fileutils.rb (touch): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_utime): allow nil to set the current time.nobu2007-03-031-4/+7
| | | | | | | | * lib/fileutils.rb (touch): ditto, and added :mtime and :nocreate options. fixed: [ruby-talk:219037] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c, gc.c, io.c, ruby.h, rubyio.h, win32/win32.h (rb_io_t):nobu2007-02-241-12/+12
| | | | | | | | | | | renamed from OpenFile. * ext/dl/cptr.c, ext/io/wait/wait.c, ext/openssl/ossl.h, ext/openssl/ossl_bio.c, ext/openssl/ossl_ssl.c, ext/pty/pty.c, ext/readline/readline.c, ext/socket/socket.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_thread_flock, rb_file_flock): use UBF feature.nobu2007-02-241-44/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file): should not call fpath_check() with NULL.usa2007-01-091-1/+3
| | | | | | | fixed: [ruby-core:09867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object): new method Dir.exist?(path).matz2006-12-071-74/+97
| | | | | | | | | | | | [ruby-core:09663] * file.c (Init_File): remove File.exists?; use File.exist? instead. * file.c: rename functions to test_* to rb_file_*_p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (test_grpowned, rb_stat_grpowned): should honormatz2006-11-221-4/+4
| | | | | | | supplementary group IDs. [ruby-core:09546] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_path_end): skip root directory. fixed: [ruby-core:08913]nobu2006-09-251-5/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (recursive_hash): remove unused local variable.matz2006-09-251-3/+2
| | | | | | | | | | | * parse.y (parser_yylex): ditto. * parse.y (rb_gc_mark_symbols): fix unmatched prototype . * file.c (rb_get_path): check NUL byte in the path string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: ISPRINT() needs ctype.hnobu2006-09-101-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_f_test): test(0) should not have any specialmatz2006-09-091-7/+8
| | | | | | | | | meaning. [ruby-dev:29425] * file.c (rb_f_test): properer error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (path_check_0, fpath_check): disable path check on cygwin.nobu2006-09-071-3/+11
| | | | | | | [ruby-talk:213074] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (path_check_0): check if sticky bit is set on parentnobu2006-09-041-7/+5
| | | | | | | directories for executable path. fixed: [ruby-dev:29415] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h (struct RArray): embed small arrays.matz2006-09-021-15/+14
| | | | | | | | | | (RARRAY_LEN): defined for accessing array members. (RARRAY_PTR): ditto. * array.c: use RARRAY_LEN and RARRAY_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (test_identical, rb_file_s_truncate): use RSTRING_PTR andusa2006-08-311-7/+7
| | | | | | | | | | | | | RSTRING_STR. * io.c (pipe_open, rb_io_reopen): ditto. * process.c (proc_spawn_n, rb_spawn): ditto. * util.c (ruby_add_suffix): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.h (struct RString): embed small strings.matz2006-08-311-28/+27
| | | | | | | | | | (RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix documentation submitted by Rick Ohnemus. ruby-Bugs-5529. [ruby-core:08725]drbrain2006-08-271-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_rename): use errno if set properly.nobu2006-08-191-1/+7
| | | | | | | fixed: [ruby-dev:29293] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_[rRwWxX]): check for super user.nobu2006-08-171-1/+27
| | | | | | | fixed: [ruby-core:08616] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_attr): make Module#attr to be an alias tomatz2006-07-201-2/+2
| | | | | | | | | | attr_reader. [RCR#331] * ruby.h: export classes/modules to implement sandbox. [ruby-core:08283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, file.c, etc.: code-cleanup patch from Stefan Huehnermatz2006-06-201-1/+1
| | | | | | | <stefan at huehner.org>. [ruby-core:08029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): add aliases invoke_method andmatz2006-06-171-1/+2
| | | | | | | | | | | | | | | | | | invoke_functional_method corresponding send and funcall respectively. [ruby-talk:197512] * parse.y (parser_yylex): returns the most typical keyword token on EXPR_FNAME. [ruby-core:7995] * ext/socket/socket.c: protoize. * parse.y (then): remove ':' from 'then' and 'do' rules. * hash.c (env_aset): raise TypeError on nil with more descriptive message. [ruby-core:07990] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c: commit miss?ocean2006-02-061-3/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (cygwin_flock): save old errno.eban2006-02-061-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_thread_flock): ERROR_NOT_LOCKED is not an error on Cygwin.eban2006-02-061-3/+20
| | | | | | | In such situation, flock() should return 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in, dln.c, file.c, intern.h, missing.h (eaccess): usenobu2006-01-251-0/+2
| | | | | | | system routine if provided. fixed: [ruby-core:07195] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=ocean2006-01-131-2/+2
| | | | | | | sizeof(void*). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* (rb_f_test): fix document. [ruby-dev:28087]akr2005-12-211-1/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (w32_io_info): should return handle because FileIndex isocean2005-12-211-14/+16
| | | | | | | valid only while file is open. [ruby-dev:28088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (w32_io_info): CreateFile failed on Win9x if file was alreadyocean2005-11-231-1/+2
| | | | | | | | opened. (FILE_SHARE_READ was needed, but actually I don't understand the flags of CreateFile well...) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (w32_io_info): should not call GetFileInformationByHandleocean2005-11-231-16/+19
| | | | | | | | | | | for pipe. * file.c (w32_io_info): checks return value from rb_w32_get_osfhandle. * file.c (w32_io_info): now can identify directory on WinNT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (test_identical): test if two files are identical.nobu2005-11-221-9/+91
| | | | | | | | | | * file.c (rb_f_test): support DOSISH systems where st_ino is not reliable. fixed: [ruby-core:06672] * win32.h, win32.c (rb_w32_osid): check the running platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_basename): skip slashes just after UNC top slashes.usa2005-11-221-1/+3
| | | | | | | | * test/ruby/test_path.rb (test_dirname, test_basename): follow new spec. and add new tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_basename): DOSISH_UNC is defined on cygwin butnobu2005-11-211-3/+3
| | | | | | | DOSISH is not. fixed: [ruby-dev:27797] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_path_skip_prefix, rb_file_s_basename): UNC without pathnobu2005-11-211-3/+26
| | | | | | | should not be splitted. fixed: [ruby-dev:27776] [ruby-dev:27786] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_dirname): should use skipprefix for UNC path.usa2005-11-181-2/+2
| | | | | | | pointed out by nobu ([ruby-dev:27744]). fixed: [ruby-core:5076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_s_dirname): added checks for some patterns with driveusa2005-11-181-1/+8
| | | | | | | | | | letter. fixed: [ruby-dev:27738] * test/ruby/test_path.rb (test_dirname): added tests for above patterns. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_load_ok): eaccess() returns 0 on success.nobu2005-11-151-1/+1
| | | | | | | fixed: [ruby-dev:27713] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_load_ok): use eaccess() instead of actually openingmatz2005-11-151-8/+2
| | | | | | | | | | the file. [ruby-talk:156378] * lib/jcode.rb (String::reverse): add new methods. [ruby-list:41245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_readlink): ERANGE will occur only on GPFS.nobu2005-11-141-6/+4
| | | | | | | [ruby-dev:27699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: undef HAVE_LINK on BeOS. (link(2) always returnsocean2005-11-101-0/+27
| | | | | | | | | | | | EINVAL, and this causes error in test/fileutils.) * file.c: overwride chown(2) and fchown(2) on BeOS. (these functions should not change user/group id if -1 is passed as corresponding argument, and this causes error in test/fileutils too) [ruby-dev:27672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_readlink): readlink(2) on AIX fails with ERANGE ifnobu2005-11-061-1/+7
| | | | | | | buffer size is less than required. fixed: [ruby-dev:27634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, file.c, ruby.c: removed strchr, strrchr, strstr definitionocean2005-10-201-6/+1
| | | | | | | | | because they are defined in missing.h. * missing.h, missing/strchr.c, missing/strstr.c: ANSI styled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e