1

i am trying to lock a certain text file with PERMISSION, and that the program and only the program could access the file & reading & changing it. even when the program is not wokring!

I've tried doing this with lockfile method but it locks the file while you are writing to it, and it is not what i need, also tried to change permission with os.chmod but i dont fully understand how it works even tho i looked up. I've tried something like that

os.chmod(stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
yarin Cohen
  • 995
  • 1
  • 13
  • 39
  • POSIX file permissions like this can't restrict access to a single program. The best you can do with these permission types is restrict access to a single user (well, and root). – Jim Stewart Jan 01 '19 at 17:35
  • Yarin, some of the answers there seem to address your needs exactly. – Ami Tavory Jan 01 '19 at 17:35

0 Answers0