Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Socket.unpack_sockaddr_un

Socket.unpack_sockaddr_un(sockaddr) => path

Unpacks sockaddr into path.

sockaddr should be a string or an addrinfo for AF_UNIX.

Example
sockaddr = Socket.sockaddr_un("/tmp/sock")
p Socket.unpack_sockaddr_un(sockaddr) #=> "/tmp/sock"