I have a file that I need to "protect" so that it cannot be copied! I am using Python on Windows XP.
I think it may just be changing file permissions??
I have a file that I need to "protect" so that it cannot be copied! I am using Python on Windows XP.
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.
Is this a temporary or a permanent file? If it's temporary, take a look at the tempfile
module, especially tempfile.mkstemp()
.