What happened to File.copy?

Discussion in 'Ruby' started by Ron Coutts, Dec 18, 2003.

  1. Ron Coutts

    Ron Coutts Guest

    Did File.copy and File.cp disappear sometime between Ruby 1.6 and 1.8?
    Is there an alternative in 1.8?

    Ron
     
    Ron Coutts, Dec 18, 2003
    #1
    1. Advertising

  2. Ron Coutts

    Hal Fulton Guest

    Ron Coutts wrote:
    > Did File.copy and File.cp disappear sometime between Ruby 1.6 and 1.8?
    > Is there an alternative in 1.8?


    #copy is not in the core, it's in the ftools library.

    Hal
     
    Hal Fulton, Dec 18, 2003
    #2
    1. Advertising

  3. Ron Coutts

    Gennady Guest

    require 'ftools'

    Ron Coutts wrote:

    > Did File.copy and File.cp disappear sometime between Ruby 1.6 and 1.8?
    > Is there an alternative in 1.8?
    >
    > Ron
    >
    >
     
    Gennady, Dec 18, 2003
    #3
  4. On Thu, 2003-12-18 at 23:48, Ron Coutts wrote:
    > Did File.copy and File.cp disappear sometime between Ruby 1.6 and 1.8?
    > Is there an alternative in 1.8?


    Try to require 'fileutils' and use FileUtils.cp or FileUtils.copy
    instead.

    --
    o=lambda{|o|p o};O=Struct.new:)a,:b,:c);e=%q(_(?h,_(?h,_(?\ ,_(?s,_(?u,_(74)),
    _(?t)),_(?t,_(?o,_(?n,_(?a))))),_(82,_(?r,_(?e),_(32)),_(32,_(98,_(?u),_(?y)))
    )),_(?r,_(99,_(97),_(?k,nil,_(?e))),_(10))));def _(*a)O.new(*a)end;class O;def
    e(&o)b&&b.e(&o);o[a];c&&c.e(&o)end;end;def p(o)print(''<<o)end;eval(e).e(&o)
     
    Florian Frank, Dec 18, 2003
    #4
  5. On Thu, 2003-12-18 at 23:56, Hal Fulton wrote:
    > #copy is not in the core, it's in the ftools library.
    >
    > Hal


    AFAIK ftools.rb is obsolete now, it's mentioned on the "old" list here:

    http://www.rubygarden.org/ruby?RubyLibraryCleanup/WhichLibrariesAreOld

    --
    o=lambda{|o|p o};O=Struct.new:)a,:b,:c);e=%q(_(?h,_(?h,_(?\ ,_(?s,_(?u,_(74)),
    _(?t)),_(?t,_(?o,_(?n,_(?a))))),_(82,_(?r,_(?e),_(32)),_(32,_(98,_(?u),_(?y)))
    )),_(?r,_(99,_(97),_(?k,nil,_(?e))),_(10))));def _(*a)O.new(*a)end;class O;def
    e(&o)b&&b.e(&o);o[a];c&&c.e(&o)end;end;def p(o)print(''<<o)end;eval(e).e(&o)
     
    Florian Frank, Dec 18, 2003
    #5
  6. Ron Coutts

    Hal Fulton Guest

    Florian Frank wrote:
    > On Thu, 2003-12-18 at 23:56, Hal Fulton wrote:
    >
    >>#copy is not in the core, it's in the ftools library.
    >>
    >>Hal

    >
    >
    > AFAIK ftools.rb is obsolete now, it's mentioned on the "old" list here:
    >
    > http://www.rubygarden.org/ruby?RubyLibraryCleanup/WhichLibrariesAreOld


    Thanks. I think I liked it better the other way.
    Doesn't really matter.

    Hal
     
    Hal Fulton, Dec 19, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Dob
    Replies:
    2
    Views:
    551
    Scott Allen
    Nov 28, 2005
  2. Alex
    Replies:
    2
    Views:
    1,254
  3. Replies:
    26
    Views:
    2,140
    Roland Pibinger
    Sep 1, 2006
  4. Mmcolli00 Mom
    Replies:
    3
    Views:
    147
    Mmcolli00 Mom
    Dec 11, 2008
  5. MaggotChild

    File::Copy::copy With File Handles

    MaggotChild, Oct 18, 2011, in forum: Perl Misc
    Replies:
    2
    Views:
    517
    Ilya Zakharevich
    Oct 22, 2011
Loading...

Share This Page