I create an unix domain socket file using this code: UNIXServer.new('tmp/my_socket.sock')
It did create socket file but the default file mode is srwxrwxr-x
,
How can I specific the mode when creating, I found nothing about this problem in ruby doc. Can someone help me out.
Asked
Active
Viewed 451 times
0

timlentse
- 195
- 2
- 11
1 Answers
0
Use File#chmod
:
UNIXServer.new('tmp/my_socket.sock')
File.chmod 0777, 'tmp/my_socket.sock'

Aleksei Matiushkin
- 119,336
- 10
- 100
- 160
-
is there another way to do that? – timlentse Sep 25 '17 at 17:21
-
There are thousands, but I believe this one is a proper one. Why? – Aleksei Matiushkin Sep 27 '17 at 05:01