Issue1942

classification
Title: [patch]missing function os.mkfifo
Type: behaviour Severity: normal
Components: Any Versions: 2.7a2
Milestone:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: fwierzbicki, wbrana
Priority: normal Keywords: patch

Created on 2012-06-30.18:03:12 by wbrana, last changed 2013-02-06.23:27:33 by fwierzbicki.

Files
File name Uploaded Description Edit Remove
mkfifo.diff wbrana, 2012-07-01.10:35:30 patch
Messages
msg7296 (view) Author: (wbrana) Date: 2012-06-30.18:03:12
Jython trunk is missing function os.mkfifo

Jython 2.7.0a2+ (default:e4afcd777d1b, Jun 30 2012, 19:33:52) 
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_33
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> dir(os.mkfifo)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'mkfifo'
>>> 
inst@local /mnt/md3/cache/inst/jython $ python
Python 2.7.3 (default, May  5 2012, 10:54:18) 
[GCC 4.4.7] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> dir(os.mkfifo)
['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
msg7360 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-08-10.17:23:50
Hi wbrana - thanks for the patch! However, this patch is too OS specific. Getting a runtime and exec'ing "mkfifo' will work ok on most Unix systems, but the error handling and integration is not going to work. To see how we do these sorts of calls in Jython have a look at src/org/python/modules/posix/PosixModule.java

See for example how we implement stat and lstat and chmod for examples of the ways we do these things. In particular note that we are heavily using the jnr.posix project from the JRuby folks. If mkfifo is in jnr.posix then it should be straightforward. If not, it would need to be added to jnr.posix.
msg7634 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-06.23:27:33
Too OS specific for Jython, closing. wbrana: if you want some help thinking about another way to get mkfifo working, feel free to email jython-dev list and we can give advice!
History
Date User Action Args
2013-02-06 23:27:33fwierzbickisetstatus: open -> closed
resolution: rejected
messages: + msg7634
2012-08-10 17:24:46fwierzbickisetpriority: normal
assignee: fwierzbicki
2012-08-10 17:23:51fwierzbickisetnosy: + fwierzbicki
messages: + msg7360
2012-07-01 10:54:28wbranasettitle: missing function os.mkfifo -> [patch]missing function os.mkfifo
2012-07-01 10:35:30wbranasetfiles: + mkfifo.diff
keywords: + patch
2012-06-30 18:03:12wbranacreate