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