]> granicus.if.org Git - python/commitdiff
Finally found a wat to set a file nonblocking that works on Irix,
authorGuido van Rossum <guido@python.org>
Mon, 12 May 1997 22:15:52 +0000 (22:15 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 12 May 1997 22:15:52 +0000 (22:15 +0000)
Solaris and Linux: use os.O_NONBLOCK.

Lib/test/test_fcntl.py

index c563018131671a083abbd9e79ad37a89a0e472d5..a5ea1e678f115ae1e3793fccb027434597d31111 100755 (executable)
@@ -12,9 +12,9 @@ filename = '/tmp/delete-me'
 
 # the example from the library docs
 f = open(filename,'w')
-rv = fcntl.fcntl(f.fileno(), FCNTL.F_SETFL, FCNTL.FNDELAY)
+rv = fcntl.fcntl(f.fileno(), FCNTL.F_SETFL, os.O_NONBLOCK)
 if verbose:
-    print 'Status from fnctl with O_NDELAY: ', rv
+    print 'Status from fnctl with O_NONBLOCK: ', rv
     
 lockdata = struct.pack('hhllhh', FCNTL.F_WRLCK, 0, 0, 0, 0, 0)
 if verbose: