summaryrefslogtreecommitdiff
path: root/lib/fileutils.rb
AgeCommit message (Collapse)Author
2007-03-04merge a cosmetic changeknu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@11989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-04* lib/fileutils.rb (mv): could not move a directory betweenknu
different filesystems. [ruby-dev:30411] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@11988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-04* file.c (rb_file_s_utime): allow nil to set the current time.knu
* 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/branches/ruby_1_8_6@11987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13* lib/fileutils.rb (FileUtils.cp_r): dereference_root=true is default in ↵aamine
Ruby 1.8. This line is wrongly removed in last commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-18* lib/fileutils.rb: backport from HEAD (rev 1.71).aamine
* lib/fileutils.rb (FileUtils.cp_r): new option :remove_destination. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-18* lib/fileutils.rb (FileUtils::fu_world_writable): make itmatz
private. [ruby-core:07383] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-19* lib/fileutils.rb (mv): should remove file after copying. [ruby-dev:28223]aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-20* lib/fileutils.rb (FileUtils::ln): ln documentation fix.ocean
[ruby-core:06661] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-23* lib/fileutils.rb (cd): no longer accept :noop option, related code is ↵aamine
useless (backported from trunk, rev 1.67). [ruby-core:05858] [ruby-Bugs:2494] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-23* lib/fileutils.rb: fix visibility of FileUtils::NoWrite, Verbose, DryRun ↵aamine
(backported from trunk, rev 1.66). [ruby-core:05954] * test/fileutils/test_nowrite.rb: test it. * test/fileutils/test_dryrun.rb: new file. * test/fileutils/test_verbose.rb: new file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-19* lib/fileutils.rb (cp_r): default is :dereference_root=>true for backward ↵aamine
compatibility. [ruby-dev:27145] * test/fileutils/test_fileutils.rb (test_cp_r): test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-18* lib/fileutils.rb: backported from trunk (rev 1.65):aamine
* lib/fileutils.rb (rm_r): new option :secure. * lib/fileutils.rb (rm_rf): new option :secure. * lib/fileutils.rb: new method #remove_entry_secure. * lib/fileutils.rb (cd): remove option :noop. * lib/fileutils.rb (cp_r): new option :dereference_root. * lib/fileutils.rb (cp_r): new option :dereference_root. * lib/fileutils.rb: new method #remove_entry. * lib/fileutils.rb: new method #chmod_R. * lib/fileutils.rb: new method #chown. * lib/fileutils.rb: new method #chown_R. * lib/fileutils.rb: new method .commands. * lib/fileutils.rb: new method .options. * lib/fileutils.rb: new method .have_option?. * lib/fileutils.rb: new method .options_of. * lib/fileutils.rb: new method .collect_method. * lib/fileutils.rb: use module_function instead of single extend. * test/fileutils/test_fileutils.rb: backported from trunk (1.36). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-14* lib/fileutils.rb (remove_file): ignore exceptions caused by chmod.aamine
* lib/fileutils.rb (remove_dir): try to get rights to rmdir. [ruby-Bugs:1502] (2 items backportted from HEAD, rev 1.53-54) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-12* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check.matz
[ruby-dev:25675] * misc/ruby-mode.el: [ruby-core:04415] * lib/rdoc/generators/html_generator.rb: [ruby-core:04412] * lib/rdoc/generators/ri_generator.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-10* lib/fileutils.rb (copy_entry): could not copy symbolic link. ↵aamine
[ruby-talk:125733] * lib/fileutils.rb (copy_stream): use read/write instead of sysread/syswrite. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-27* lib/fileutils.rb (mv): should raise error when moving a directory to the ↵aamine
(empty) directory. [ruby-talk:124368] (backport from HEAD 1.48) * lib/fileutils.rb (mv): wrongly did not overwrite file on Win32 platforms. (backport from HEAD 1.48) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-24* lib/fileutils.rb (mkdir, mkdir_p): should ensure directory permission. ↵aamine
(backportted from HEAD, 1.47) * lib/fileutils.rb (traverse, remove_dir): untaint trasted objects. (backportted from HEAD, 1.46) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-17* lib/fileutils.rb (mkdir_p): backport from CVS HEAD 1.45. [ruby-core:03420]aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-08-14* lib/fileutils.rb: backport from CVS HEAD (rev1.44).aamine
* lib/fileutils.rb: cp_r should copy symlink itself, except cp_r root. * lib/fileutils.rb: new option mv :force. * lib/fileutils.rb: new module FileUtils::DryRun. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-07* lib/fileutils.rb (fu_list): Array() breaks pathes including "\n". ↵aamine
[ruby-core:02843] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-10* lib/fileutils.rb (remove_dir): should handle symlink correctly. This ↵aamine
patch is contributed by Christian Loew. [ruby-talk:94635] (Backport from main trunk) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-12* lib/fileutils.rb (mkdir): remove trailing `/' from pathes.aamine
* lib/fileutils.rb (rmdir): ditto. [ruby-dev:22238] * lib/fileutils.rb (rmdir_r): ditto. * lib/fileutils.rb (fu_copy_dir): check if it is a directory after mkdir(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-11* lib/fileutils.rb (mkdir_p): remove trailing `/' befere mkdir(2). ↵aamine
mkdir("nonexistdir/") does not work on NetBSD/Alpha 1.6.1. * lib/fileutils.rb (fu_list): call to_str for all arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-11catch all SystemCallErrors.aamine
* lib/fileutils.rb (mkdir_p): catch all SystemCallErrors (mkdir("C:\") causes EACCESS on Windows 2000/NTFS). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-11* lib/fileutils.rb (mkdir_p): check if it is a directory after mkdir(2) ↵aamine
instead of before mkdir(2), to avoid race condition. [ruby-talk:87730] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-11* lib/fileutils.rb: def m( arg ) -> def m(arg).aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-01* lib/fileutils.rb (fu_each_src_dest0): call #to_str to allow Pathname for ↵aamine
arguments. [ruby-core:01795] * test/fileutils/test_fileutils.rb: does much strict test on "same" files detecting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22* lib/fileutils.rb (have_st_ino?): djgpp has valid st_ino.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22* gc.c (Init_stack): stack region is far smaller than usual ifmatz
pthread is used. * marshal.c (w_extended): singleton methods should not be checked when dumping via marshal_dump() or _dump(). [ruby-talk:85909] * file.c (getcwdofdrv): avoid using getcwd() directly, use my_getcwd() instead. * merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine <sunshine@sunshineco.com>. [ruby-core:01596] * marshal.c (w_object): LINK check earlier than anything else, i.e. do not dump TYPE_IVAR for already dumped objects. (ruby-bugs PR#1220) * eval.c (rb_eval): call "inherited" only when a new class is generated; not on reopening. * eval.c (eval): prepend error position in evaluating string to * configure.in: revived NextStep, OpenStep, and Rhapsody ports which had become unbuildable; enhanced --enable-fat-binary option so that it accepts a list of desired architectures (rather than assuming a fixed list), or defaults to a platform-appropriate list if user does not provide an explicit list; made the default list of architectures for MAB (fat binary) more comprehensive; now uses -fno-common even when building the interpreter (in addition to using it for extensions), thus allowing the interpreter to be embedded into a plugin module of an external project (in addition to allowing embedding directly into an application); added checks for <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now ensures that -I/usr/local/include is employed when extensions' extconf.rb scripts invoke have_header() since extension checks on NextStep and OpenStep will fail without it if the desired resource resides in the /usr/local tree; fixed formatting of --help message. * Makefile.in: $(LIBRUBY_A) rule now deletes the archive before invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives (see configure's --enable-fat-binary option); added rule for new missing/getcwd.c. * defines.h: fixed endian handling during MAB build (see configure's --enable-fat-binary option) to ensure that all portions of the project see the correct WORDS_BIGENDIAN value (some extension modules were getting the wrong endian setting); added missing constants GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H define in NeXT section. * dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on NextStep since, on some installations, this value always resolves uselessly to zero. * dln.c: added error reporting to NextStep extension loader since the previous behavior of failing silently was not useful; now ensures that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice on Rhapsody since this header lacks multiple-include protection, which resulted in "redefinition" compilation errors. * main.c: also create hard reference to objc_msgSend() on NeXT platforms (in addition to Apple platforms). * lib/mkmf.rb: now exports XCFLAGS from configure script to extension makefiles so that extensions can be built MAB (see configure's --enable-fat-binary option); also utilize XCFLAGS in cc_command() (but not cpp_command() because MAB flags are incompatible with direct invocation of `cpp'). * ext/curses/extconf.rb: now additionally checks for presence of these curses functions which are not present on NextStep or Openstep: bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(), setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(), wscrl(), wsetscrreg() * ext/curses/curses.c: added appropriate #ifdef's for additional set of curses functions now checked by extconf.rb; fixed curses_bkgd() and window_bkgd() to correctly return boolean result rather than numeric result; fixed window_getbkgd() to correctly signal an error by returning nil rather than -1. * ext/etc/etc.c: setup_passwd() and setup_group() now check for null pointers before invoking rb_tainted_str_new2() upon fields extracted from `struct passwd' and `struct group' since null pointers in some fields are common on NextStep/OpenStep (especially so for the `pw_comment' field) and rb_tainted_str_new2() throws an exception when it receives a null pointer. * ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(). * ext/socket/getaddrinfo.c: cast first argument of getservbyname(), gethostbyaddr(), and gethostbyname() from (const char*) to non-const (char*) for older platforms such as NextStep and OpenStep. * ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(); include <netinet/in_systm.h> if present for NextStep and OpenStep; cast first argument of gethostbyaddr() and getservbyname() from (const char*) to non-const (char*) for older platforms. * ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for platforms such as NextStep and OpenStep which lack strdup(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-20* lib/fileutils.rb (have_st_ino?): emx (OS/2 with EMX) does not have st_ino ↵aamine
(always 0). [ruby-dev:21972] * lib/fileutils.rb (rename_cannot_overwrite_file?): emx does not allow overwriting files by rename(2). * test/fileutils/test_fileutils.rb: windows? -> have_drive_letter?, have_file_perm? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-19* lib/fileutils.rb (fu_same?): add djgpp and wince.aamine
* lib/fileutils.rb (cannot_overwrite?): add wince. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-19* lib/fileutils.rb (cannot_overwrite_file?, have_st_ino?): bccwin32usa
is same as mswin32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-18* lib/fileutils.rb (fu_same?): temporal fix for windows.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-18* lib/fileutils.rb (fu_same?): check by inode instead of path name, to ↵aamine
detect two hard links pointing to the same content. * test/fileutils.rb: did not create correctly looped symlinks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-18* lib/fileutils.rb (fu_each_src_dest): raise if src==dest. [ruby-talk:85344] ↵aamine
[ruby-core:01699] * lib/fileutils.rb: use Object#is_a? instead of Class#=== to allow e.g. remote objects for receivers. * lib/fileutils.rb: FileTest -> File. * lib/fileutils.rb: put parentheses for arguments of File.xxxx? * test/fileutils/test_fileutils.rb (test_cp): test "cp a a". * test/fileutils/test_fileutils.rb (test_mv): test "mv a a". * test/fileutils/test_fileutils.rb (test_ln): test "ln a a". * test/fileutils/test_fileutils.rb (test_ln_s): test "ln_s a a". * test/fileutils/test_fileutils.rb (test_install): test "install a a". * test/fileutils/fileasserts.rb: new method assert_symlink. * test/fileutils/fileasserts.rb: assert_is_directory -> assert_directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-30* io.c (READ_DATA_BUFFERED): new macro to detect whether stdiomatz
buffer filled. * io.c (rb_io_fptr_cleanup): move path deallocation to rb_io_fptr_finalize (finalizer called by GC). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-08-05* lib/fileutils.rb (install): should preserve timestamp only.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-29* lib/fileutils.rb (install): support preserve timestamp.eban
* instruby.rb (install): use FileUtils::install preserve mode. * lib/un.rb: new. % ruby -run -e cp -- -p foo bar * lib/mkmf.rb: use un.rb instead of ftools.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-05-02* lib/fileutils.rb: use hashes to pass options.aamine
* lib/fileutils.rb: new option mkdir(:mode), mkdir_p(:mode). * instruby.rb: follow fileutils.rb feature change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-15* lib/net/fileutils.rb: rm_r should raise Errno::ENOENT if file not exist. ↵aamine
[ruby-core:958] Thanks Johan Holmberg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-09* lib/fileutils.rb (mkdir, mkdir_p): revert.eban
* instruby.rb (umask): umask 0022, not 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-09* lib/fileutils.rb (mkdir, mkdir_p): set mode to 0755.eban
* Makefile.in (fake.rb): set ALT_SEPARATOR to the default value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-23* lib/fileutils (fu_stream_blksize): wrong logial condition.eban
(and -> or). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-21* lib/fileutils.rb: new method FileUtils#copy_stream.aamine
* lib/fileutils.rb: new method FileUtils#compare_file. * lib/fileutils.rb: new method FileUtils#compare_stream. * lib/fileutils.rb: new method FileUtils#rmtree (alias of rm_rf). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-10* lib/fileutils.rb (FileUtils#uptodate?): use mtime for comparison.aamine
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-08* lib/fileutils.rb: new method FileUtils.pwd (really).aamine
* lib/fileutils.rb: FileUtils.pwd, cmp, identical?, uptodate? does not accept any option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-02-06* lib/fileutils.rb: new method FileUtils.pwd.aamine
* lib/fileutils.rb: default label is ''. * lib/fileutils.rb: using module_eval again, to avoid ruby's bug. * lib/fileutils.rb: fix wrong examples in rdoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-25*** empty log message ***nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-24Converted RD to RDoc and improved documentation. See comments at EOF.gsinclair
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-01-06* lib/fileutils.rb (ln): add ' -f' in the verbose message.eban
* lib/fileutils.rb (cp_r): add 'p' in the verbose message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e