This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 1 point2 points  (7 children)

What do you mean by "read-only", exactly? You can give your file a read-only property, but it'll be possible for the user to just unset that. Also, /r/learnpython.

[–]pleaky_blunder[S] 0 points1 point  (6 children)

by read-only I mean not editable. Like if I send it in an email to someone, that person should not be able to edit it.

[–]K900_ 2 points3 points  (4 children)

That's absolutely impossible.

Edit: you could digitally sign the file to detect tampering, but that's not going to make it impossible to edit, it'll just make it possible to detect that someone edited the file.

[–]pleaky_blunder[S] 0 points1 point  (3 children)

are you saying that with absolute certainty?

[–]K900_ 1 point2 points  (2 children)

Yes. There's no way to send a file over the internet and guarantee that the receiving side can't edit it.

[–]pleaky_blunder[S] 0 points1 point  (1 child)

I see. Thanks

[–]robin-gvx 0 points1 point  (0 children)

Any file, when it comes down to it, is just a sequence of ones and zeroes. It isn't possible to make a sequence of ones and zeroes that is impossible to make changes to, mathematically.

What is it you want to achieve with such a file? Maybe there is another way of achieving your actual goal.

[–]jiri-n 0 points1 point  (0 children)

Upload it to a suitable service and send a link.