How to use "fcntl.lockf" in Python?
How to use "fcntl.lockf" in Python? Question: I found this question but I do not know how to use the suggestion. I have tried with open(fullname) as filein: fcntl.lockf(filein, fcntl.LOCK_EX | fcntl.LOCK_NB) and with open(fullname) as filein: fcntl.lockf(filein.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB) but in both cases I get an error OSError: [Errno 9] Bad file descriptor …
Total answers: 1