Check if a symlink point to a directory or not

Hi guys, I have a special request, I need to check in crystal if a symlink point to a directory or not.

How can I do this ?

You can check whether it’s a directory with

Dir.exists? "path/to/symlink"

This will follow symlinks by default.

Otherwise if you want to know whether it’s a symlink in the first place, you can do

File.symlink? "path/to/symlink"

My bad, I think I did something wrong in my code. So the problem don’t come from this probably .

Thank you anyway :blush: