[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

FILEUTILS cp/cp_r rm/rm_r on Windows XP

James Byrne

3/30/2008 11:18:00 PM

I cannot seem to get these commands to work as expected in Windows XP
pro SP2.

Given this

task :update do
FileUtils.cp_r File.join(File.dirname(__FILE__), 'views/xyz/'),
File.join(File.dirname(__FILE__), '../../../app/views')
end

I get this:

unknown file type: C:/path/to/source/views/xyz/

Given this:

task :remove do
FileUtils.rm_rf File.join(File.dirname(__FILE__),
'../../../app/views/xyz') rescue nil
end

I get no errors, but the directory is not removed either. Can someone
point out my error?

Regards,
--
Posted via http://www.ruby-....

2 Answers

James Byrne

3/31/2008 12:27:00 AM

0

James Byrne wrote:
> I cannot seem to get these commands to work as expected in Windows XP
> pro SP2.
>

I discovered my error by running these with :verbose => true. As agent
86 would say: "Missed me by that much."

I needed an extra set of '../' to reach the actual target directories.

--
Posted via http://www.ruby-....

Luis Lavena

3/31/2008 2:13:00 AM

0

On Mar 30, 9:27 pm, James Byrne <byrn...@harte-lyne.ca> wrote:
> James Byrne wrote:
> > I cannot seem to get these commands to work as expected in Windows XP
> > pro SP2.
>
> I discovered my error by running these with :verbose => true. As agent
> 86 would say: "Missed me by that much."
>
> I needed an extra set of '../' to reach the actual target directories.
>

I'll suggest you use RAILS_ROOT and join to it instead of guessing
based on the location of your rakefile ;-)

File.join(RAILS_ROOT, 'app/views')

HTH,
--
Luis Lavena