# File lib/daemon_kit/core_ext/string.rb, line 7
  def to_absolute_path
    # Pathname is incompatible with Windows, but Windows doesn't have
    # real symlinks so File.expand_path is safe.
    if RUBY_PLATFORM =~ /(:?mswin|mingw)/
      File.expand_path( self )

      # Otherwise use Pathname#realpath which respects symlinks.
    else
      begin
        File.expand_path( Pathname.new( self ).realpath.to_s )
      rescue Errno::ENOENT
        File.expand_path( Pathname.new( self ).cleanpath.to_s )
      end
    end
  end