Message10670

Author zyasoft
Recipients amak, fwierzbicki, wbrana, zyasoft
Date 2016-01-26.21:20:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1453843258.67.0.0829718094965.issue1943@psf.upfronthosting.co.za>
In-reply-to
Content
Also used in the package youtube-dl for file locking support:

    import fcntl

    def _lock_file(f, exclusive):
        fcntl.flock(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)

    def _unlock_file(f):
        fcntl.flock(f, fcntl.LOCK_UN)

This specific functionality is implementable with https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileLock.html, which is likely to be portable than JNR for this particular support (based on previous experience - use JNR only when nothing else is available in Java).
History
Date User Action Args
2016-01-26 21:20:58zyasoftsetmessageid: <1453843258.67.0.0829718094965.issue1943@psf.upfronthosting.co.za>
2016-01-26 21:20:58zyasoftsetrecipients: + zyasoft, fwierzbicki, amak, wbrana
2016-01-26 21:20:58zyasoftlinkissue1943 messages
2016-01-26 21:20:57zyasoftcreate