Thanks for the help, Keith. I really did _not_ want to use 'system', but
when I didn't find a 'copy' method
in the standard File class, I thought I should try the ugly way. Maybe I
should buy the book.

Barry


-----Original Message-----
From: Keith G. Weinberg [mailto:keith / groupdigital.com]
Sent: Tuesday, December 05, 2000 8:28 PM
To: ruby-talk / netlab.co.jp
Subject: [ruby-talk:6821] Re: copy , using 'system'


try these:
	system("cp","file","newfile")
	OR
	system("copy","file","newfile")
	OR JUST
	`copy file newfile`

It sounds like your REALLY want to use system, but a better way might
be to use the ftools library like this.

require 'ftools'

File.copy 'file', 'newfile'

Dave Thomas wrote a very good book on the language that you can buy.
You can see it at his website, 
http://www.pragmaticprogrammer.com/ruby/index.html

Good luck,
/<

"SHULTZ,BARRY (HP-Israel,ex1)" wrote:
> 
> Hello,
>  I've just been using Ruby for a few days, so please bear with me.
> I want to copy a file using the 'system' function. I am running
> Win NT4, SP5 and have tried:
> 
> system 'copy file newfile'
> system 'cp file newfile'
> system "copy file newfile"
> system "cp file newfile"
> 
> The copy is never performed, and the value of $? is 32512.
> Any help would be appreciated.
> 
> Regards,
> Barry