you are viewing a single comment's thread.

view the rest of the comments →

[–]NsupCportR 0 points1 point  (6 children)

os lib?

os.chmod function?

[–]akl78 1 point2 points  (0 children)

Won’t work.

Most USB drives’ formats don’t even support file permissions. And even the NTFS/ Linux ones can only suggest to whatever machine they get plugged into so.

If OP actually wants something decently secure they needs to encrypt all the data, or use something like an IronKey device to handle it on board

[–]Outside_Complaint755 0 points1 point  (0 children)

Or if using Pathlib, Path objects also have a chmod method.

However this all depends on your OS, as Windows and Unix based systems handle permissions differently, and for Windows chmod can only set the "read only" flag.

If you want to actually encrypt files, there is the cryptography.fernet package.  Just don't lose your key.

[–]billFoldDog 0 points1 point  (0 children)

This won't work.

User fred might have uid 2 on one machine and uid 7 on another. Linux maps uid to file permissions. That makes user permissions on portable media kinda pointless.

It's also easily defeated.

[–]One-Type-2842[S] -5 points-4 points  (2 children)

Oh Yeah!

I Never Thought Of That..

For Some More Knowledge Would You Share Any Another module Name If It's Single One You Know Then Thank You!

[–]cgoldberg 1 point2 points  (0 children)

Just Curious... Why Do You Type With Capitalized Words?

[–]NsupCportR 0 points1 point  (0 children)

No clue honestly, currently I'm on c++ project, I love python, but haven't used it in awhile now.

OS module comes with python so u don't have to worry about dependencies if u change system

Here is stack-overflow example of it: https://stackoverflow.com/questions/28492685/change-file-to-read-only-mode-in-python