P
Paulo da Silva
How are those "files" of type "socket", whose name
begins with "=", created? How can I create them with
python?
Thanks.
begins with "=", created? How can I create them with
python?
Thanks.
How are those "files" of type "socket", whose name
begins with "=", created? How can I create them with
python?
Marcos said:they don't start w/ =; that's just ls being verbose. try 'ls -1'.
you can create them with os.mkfifo. see lib doc, section 6.1.4.
they don't start w/ =; that's just ls being verbose. try 'ls -1'.
you can create them with os.mkfifo. see lib doc, section 6.1.4.
....Irmen said:Marcos Dione wrote:
....
mkfifo creates fifo nodes, not "socket"-type files.
I think Unix domain sockets are what the OP means...
Which are created by using the AF_UNIX socket type:
from socket import *
sock=socket(AF_UNIX,SOCK_STREAM)
sock.bind("/tmp/mysocket")
Paulo said:....
...
This seems more logical. Besides there is also a "file" type
"fifo" where I was using mkfifo.
I'll give it a try. Unfortunately I began to upgrade my Gentoo
Linux and I am busy now.
Paulo da Silva said:> [...]> > from socket import *
> > sock=socket(AF_UNIX,SOCK_STREAM)
> > sock.bind("/tmp/mysocket")
>
> OK. It works! I'll use mkfifo for "fifo" type and this for
> "socket" type.
> BTW, don't I need to close "sock.close()"? I don't want to
> do anything with the socket except keeping it on disk.
Well, I never programmed anything using fifo or sockets.Oliver said:Why exactly do you want to create one and keep it on disk
without doing anything with it? That doesn't seem make any
sense at all.
Oliver said:Uhm, are you sure you know what you're doing? UNIX domain
sockets work very similar to Internet domain sockets, i.e.
they disappear when they're closed (or when your program
exits, in which case everything is closed implicitly).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.