[python-win32] Mailslot
Tim Roberts
timr at probo.com
Mon Dec 10 20:00:25 CET 2007
Michel Claveau wrote:
> Mailslot is a simple & fast IPC (Inter Processus Call) (who use UDP & SMB).
> It's inside Windows from long time ago.
>
> With Vista, the (re)-new tool Waitfor.exe can use it, for synchronize
> batchs, applis or scripts (in local computer or in a LAN).
>
> This next code show the use of Python+PyWin32 for send a signal to Mailslot.
> Like a "client" Mailslot:
>
> import win32file,win32con
> mailslot =
> win32file.CreateFile(r'\\.\mailslot\waitfor.exe\ALERTTEST',
> win32file.GENERIC_WRITE, 0, None, win32con.CREATE_NEW, 0, None)
> win32file.WriteFile(mailslot, "ABC")
> mailslot.Close()
>
>
> Now, my problem is: I am not able to write a Mailslot server. I don't
> found any wrapper of the (kernel32) CreateMailslot et ReadFile functions.
>
> On this subject, Google is not my friend...
>
You can use ctypes to do this, of course.
http://www.asahi-net.or.jp/~sy7a-ht/sipc.py
Once you have the handle, you don't really need ReadFile and WriteFile.
You can use the Python I/O routines. Not sure it's any better.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list