[英]How do I use Python to prevent a file from being copied?
I have a file that I need to "protect" so that it cannot be copied! 我有一个需要“保护”的文件,因此无法复制! I am using Python on Windows XP.
我在Windows XP上使用Python。
I think it may just be changing file permissions?? 我认为可能只是在更改文件权限??
You can prevent the file being copied only by removing read permission from the user that shouldn't be able to copy the file. 您可以仅通过从不应复制文件的用户中删除读取权限来防止文件被复制。 You can use
os.chmod
for this, or see this page explaining to set permissions with the full Windows security model. 您可以为此使用
os.chmod
,或参阅此页面说明使用完整的Windows安全模型设置权限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.