[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Fileutils::copy_entry() won't copy symlinks without dereferencing

e

1/9/2005 8:55:00 PM

> Lähettäjä: leon breedt <bitserf@gmail.com>
> Aihe: Re: Fileutils::copy_entry() won't copy symlinks without dereferencing
>
> On Mon, 10 Jan 2005 05:12:18 +0900, Andrew Walrond <andrew@walrond.org> wrote:
> > But I cannot get a symlink to copy as a symlink. Example:
> This appears to be a bug.
>
> In my version of Ruby, File.stat('/some/symlink').file? returns true
> if the symlink points to a file.
>
> If you look at fileutils.rb, you'll see the case statement in
> CopyContext_#_copy_entry puts the st.file? condition before the
> st.symlink? condition, so st.symlink? will never be true, and
> #_copy_content will always be used.

A fix would be to switch the File#stat to File#lstat, if
you have access to the source, I suppose.

> Leon

E