Problem with symlink generated by Crystal

Hello, I’m posting because I’m encounter always a problem with the functions from FileUtils to generate symlink.

Few time ago, I had to fix a bug because the function ln_sf normally remove the old link, but it didn’t do.
Now I have again an another problem.

At this step of the LFS :Linux From Scratch, I had to translate just this:
ln -s gthr-posix.h libgcc/gthr-default.h
to this:
makeSymbolicLink("gthr-posix.h","#{mainWorkDirectoryPath}/libgcc/gthr-default.h")

This function is implemented like that:

def makeSymbolicLink(path : String, targetPath : String)
            begin
                if File.symlink?(targetPath)
                    deleteFile(targetPath)
                end
                FileUtils.ln_s(path, targetPath)
            rescue error
                Ism.notifyOfMakeSymbolicLinkError(path, targetPath)
                pp error
                exit 1
            end
        end

Don’t pay attention about the path, they are correct. It’s because my software use and another path.

When I compile libstdc++ just by hand and I make with the terminal the symlink, the header is linked properly, but when I make the symlink with crystal, it can’t found it.

Why ???

I swapped FileUtils.ln_s by FileUtils.ln_sf just to see if something change, but no :neutral_face:

It should work. you don’t need check the existance of symlink if you use FileUtils.ln_sf