Latest recipes tagged "meta:requires=pywintypes" and "files"http://code.activestate.com/recipes/tags/meta:requires=pywintypes+files/new/2008-05-16T21:12:08-07:00ActiveState Code Recipesportalocker - Cross-platform (posix/nt) API for flock-style file locking. (Python)
2008-05-16T21:12:08-07:00Jonathan Feinberghttp://code.activestate.com/recipes/users/1511/http://code.activestate.com/recipes/65203-portalocker-cross-platform-posixnt-api-for-flock-s/
<p style="color: grey">
Python
recipe 65203
by <a href="/recipes/users/1511/">Jonathan Feinberg</a>
(<a href="/recipes/tags/files/">files</a>).
Revision 7.
</p>
<p>Synopsis:</p>
<p>import portalocker
file = open("somefile", "r+")
portalocker.lock(file, portalocker.LOCK_EX)
file.seek(12)
file.write("foo")
file.close()</p>