Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Socket.unpack_sockaddr_un

(::String path) -> ::String
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"