From: E S Date: 2005-01-10T05:55:19+09:00 Subject: Re: Fileutils::copy_entry() won't copy symlinks without dereferencing > L�hett�j�: leon breedt > Aihe: Re: Fileutils::copy_entry() won't copy symlinks without dereferencing > > On Mon, 10 Jan 2005 05:12:18 +0900, Andrew Walrond 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