summaryrefslogtreecommitdiff
path: root/file.c
AgeCommit message (Collapse)Author
2012-12-19merge revision(s) 34871: [Backport #7415]usa
* file.c (file_expand_path): use wcscasecmp(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-09* file.c (append_fspath): no need to do encoding trick here.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-09* file.c (append_fspath): revert a part of r37562.usa
* file.c (rb_file_expand_path_internal): ditto. * file.c (rb_file_expand_path_internal): ignore the encoding of the given path name and use filesystem encoding, except when the result is 8bit range and the filesystem encoding is US-ASCII. [ruby-dev:39393] [Bug #2154] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-08* file.c (append_fspath): filesystem encoding is prior to the encodingusa
of argument. * file.c (rb_file_expand_path_internal, EXPAND_PATH_BUFFER): ignore the encoding of the given path name, use filesystem encoding always instead. [ruby-dev:39393] [Bug #2154] * test/ruby/test_file_exhaustive.rb: removed 2.0 spec tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26merge revision(s) 34397: [Backport #6881]usa
* file.c (append_fspath): need to set the encoding to result always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26merge revision(s) 34374: [Backport #6681]usa
* file.c (rmext): no extension to strip if empty string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26merge revision(s) 32826,34732: [Backport #6681]usa
* file.c (rb_enc_path_next, rb_enc_path_skip_prefix) (rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions. * file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [ruby-dev:45145] [Bug #5919] * dir.c (check_dirname, ruby_glob0): ditto. * ext/pathname/pathname.c (path_sub_ext): ditto. * util.c, include/ruby/util.h (ruby_add_suffix): remove the function. [Bug #5153] [ruby-core:38736] * io.c (argf_next_argv): remove the call of above function. * ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test extension module because this is only for testsing ruby_add_suffix(). * LEGAL: remove the mention about a part of util.c, because now we removed the part. * io.c (argf_next_argv): now the new filename is not guranteed to use, so should check the return value of rename(2). * test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible): now we expect same result with other platforms on no_safe_rename platforms (=Windows). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25merge revision(s) ↵usa
34849,34853,34854,34855,34859,34862,35384,35385,36811,36812,36850,36907,36908: [Backport #7174] * Makefile.in (PLATFORM_DIR): add a variable for `win32` directory. * Makefile.in (clean-platform): add new target. It cleans `win32` directory. * common.mk (clean): add a dependency for `win32` directory. * common.mk (distclean): ditto. * common.mk (distclean-platform): add new target. It cleans `win32` directory. * common.mk ($(PLATFORM_D)): add new target to make `win32` directory. * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32` directory. * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c. * configure.in: move win32.o into `win32` directory and add win32/file.o to MISSING. * file.c (file_load_ok, rb_file_load_ok): replace static file_load_ok() with public rb_file_load_ok(). It's to link Windows implementation in win32/file.c. * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * win32/file.c (rb_file_load_ok): new file. Add Windows specific optimized implementation of rb_file_load_ok(). We created a separated file to avoid too many #ifdef macro which is unreadable. * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32` directory. * win32/Makefile.sub (MISSING): move win32.obj into `win32` directory and add win32/file.obj to MISSING. * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY. It's because miniruby doesn't exist when making `win32` directory. * win32/Makefile.sub (clean-platform): add new target to clean `win32` directory. * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match win32/file.c to build properly. * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into `win32` directory. Patch created with Luis Lavena. [ruby-core:42480] [Feature #5999] * win32/Makefile.sub (MAKEDIRS): use mkdir of cmd.exe instead of ruby. [Bug #6103] [ruby-core:43012] * win32/README.win32: added a notice about command extension of cmd.exe. * win32/makedirs.bat: new command to make intermediate directories, and not to report any errors if the directory already exists. * win32/Makefile.sub (MAKEDIRS): enable command extensions. * win32/file.c (INVALID_FILE_ATTRIBUTES): define for old SDK. * configure.in (mingw): add shlwapi to the list of dependency libs for Windows. * win32/Makefile.sub (EXTSOLIBS): ditto. * internal.h: declare internal functions rb_w32_init_file, rb_file_expand_path_internal and rb_file_expand_path_fast. * file.c (Init_File): invoke Windows initialization rb_w32_init_file * win32/file.c (rb_file_load_path_internal): new function. Windows-specific implementation that replaces file_expand_path. [Bug #6836][ruby-core:46996] * win32/file.c (rb_w32_init_file): new function. Initialize codepage cache for faster conversion encodings lookup. * file.c (file_expand_path): rename to rb_file_expand_path_internal. Conditionally exclude from Windows. * file.c (rb_file_expand_path_fast): new function. delegates to rb_file_expand_path_internal without performing a hit to the filesystem. * file.c (file_expand_path_1): use rb_file_expand_path_internal without path expansion (used by require). * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * load.c (rb_get_expanded_load_path): use rb_file_expand_path_fast. * load.c (rb_feature_provided): ditto. * file.c (rb_file_expand_path): use rb_file_expand_path_internal with path expansion. * file.c (rb_file_absolute_path): ditto. * test/ruby/test_file_exhaustive.rb: new tests to exercise rb_file_expand_path_internal implementation and compliance with existing behaviors. * test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for posix environments where HOME is not defined. [ruby-core:47322] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16merge revision(s) 36800: [Backport #6377]usa
* file.c (rb_find_file_ext_safe, rb_find_file_safe): default to US-ASCII for encdb and transdb. * load.c (search_required): keep encoding of feature name. set loading path to filesystem encoding. [Bug #6377][ruby-core:44750] * ruby.c (add_modules, require_libraries): assume default external encoding as well as ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-12merge revision(s) 37163:usa
* file.c (rb_get_path_check): path name must not contain NUL bytes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-20merge revision(s) 33991:naruse
* file.c (file_path_convert): don't convert it when the path string is ascii only. [ruby-core:41556] [Bug #5733] tests are contributed by nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-04Fix previous commit.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03Revert r36279; it breaks C API compatibility.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03merge revision(s) 34374:naruse
* file.c (rmext): no extension to strip if empty string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03merge revision(s) 34372:naruse
* file.c (rb_enc_path_next, rb_enc_path_skip_prefix) (rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions. * file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [ruby-dev:45145] [Bug #5919] * dir.c (check_dirname, ruby_glob0): ditto. * ext/pathname/pathname.c (path_sub_ext): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-01merge revision(s) r33525: [Backport #6104]naruse
* file.c (rb_file_join): honor input encodings than ASCII-8BIT. [ruby-core:40338] [Bug #5483] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25merge revision(s) 34792:naruse
* file.c (utime_internal): fix a variable missed to replace. [ruby-core:42864] [Bug #6077] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25merge revision(s) 34786,34787,34788,34789:naruse
* dir.c, file.c, io.c: use rb_sys_fail_path. * error.c: new functions to deal exceptions with string instances. * dir.c, file.c, io.c (rb_sys_fail_path): use rb_sys_fail_str. * test/ruby/test_literal.rb (TestRubyLiteral#test_special_const): test for https://bugs.php.net/bug.php?id=61095 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-06merge revision(s) 33603:usa
* file.c (file_expand_path): reset coderange after expanding path. [Backport #5601] [Backport #5629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20* backport r32579, r32581, r32587 by akr and r32588 by kazu.akr
r32579: * io.c (rb_update_max_fd): new function. * internal.h (rb_update_max_fd): declare rb_update_max_fd. * thread_pthread.c (rb_thread_create_timer_thread): update max fd when timer thread pipe is created. r32581: * io.c (UPDATE_MAXFD): removed. r32587: * include/ruby/intern.h (rb_update_max_fd): declaration moved from internal.h. * file.c: ditto. * io.c: call rb_update_max_fd for each new fds. * process.c: ditto. * random.c: ditto. * ruby.c: ditto. * ext/io/console/console.c: ditto. * ext/openssl/ossl_bio.c: ditto. * ext/pty/pty.c: ditto. * ext/socket/init.c: ditto. * ext/socket/socket.c: ditto. * ext/socket/ancdata.c: ditto. * ext/socket/unixsocket.c: ditto. r32588: * io.c (rb_update_max_fd): remove parentheses. they are not in macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16* fix for build on solaris 10.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-15* file.c (rb_stat_rdev): use DEVT2NUM.naruse
* file.c (rb_stat_rdev_major): ditto. * file.c (rb_stat_rdev_minor): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-26* file.c (rb_file_truncate): fix function.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-11* file.c (rb_group_member): kill 256K of stack usage.kosaki
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
2011-02-20* file.c (rb_file_flock): use rb_thread_io_blocking_region for thenobu
time being. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-27 * file.c (w32_io_info): get rid of too huge alloca().kosaki
[Bug #4313] [ruby-core:34830] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26* file.c (file_expand_path): get rid of warnings caused bynobu
-Wdeclaration-after-statement on cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-13* file.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-06fix typoskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-20NTFS's ctime is creation time! [ruby-core:33269]naruse
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
2010-11-11* file.c (file_expand_path): use cygwin_conv_path on cygwin 1.7 ornobu
later. * ruby.c (push_include_cygwin): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15* file.c (NUM2DEVT, DEVT2NUM, PRI_DEVT_PREFIX): fallback tonobu
unsigned int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15* configure.in (dev_t): use RUBY_REPLACE_TYPE.nobu
* 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
2010-10-14Refix for r29493; it is unsigned.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* file.c (DEVT2NUM): added. Size of dev_t is depend on thenaruse
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
2010-09-04* file.c (rb_file_s_readlink): symlink target should be innobu
filesystem encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-29* file.c (rb_get_path_check): clarify error message fornobu
ASCII-incompatible path name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-27* file.c (null_device): move from io.c.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-06* file.c (realpath_rec): rb_str_modify depends on the length, sonobu
resize instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-04* file.c (realpath_rec): call rb_str_modify before rb_str_set_len.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-02* file.c (file_expand_path): wrong condition. [ruby-core:31591]usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-30 * file.c (file_expand_path): suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29* file.c (file_expand_path): home directory must be absolute.nobu
[ruby-core:31537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29* file.c (file_expand_path): should check if could find user.nobu
[ruby-core:31538] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-28* file.c (rb_file_s_basename): pass baselen to rmext.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:naruse
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
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
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
2010-07-07* file.c (ruby_find_basename): set correct baselen.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-07* file.c (ruby_find_basename): should initialize f.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e