Perhaps make it a tad cleaner with:

begin
  fs = if s.directory?
    Dir.entries(file)
  elsif s.symlink?
    Dir.entries File.readline(file)
  else
    next
  end
rescue ...