[IronPython] How to lock a file like win32file.LockFileEx()?
sanxiyn at gmail.com
Wed Nov 22 11:52:55 CET 2006
2006/11/21, Patrick O'Brien <sum.ergo.code at gmail.com>:
> What would one use in IronPython to get the equivalent of fcntl.flock() or
.NET's FileStream has Lock() and Unlock() methods, but I don't know
how to apply these to IronPython file object. Any idea?
One could use P/Invoke too.
Example IronPython code:
from System.IO import FileStream, FileMode
f = FileStream('test', FileMode.Open)
Above is roughly equivalent to following CPython/Unix code:
f = open('test', 'w')
More information about the Ironpython-users