0

How can I add an existing local data folder into a Pycharm project? How can I specify this folder (and everything under it) as read only?

I have a lot of data in shared OneDrive folder, the local copy exist in my computer hard disk. I would like use that data as read only for my Python codes and be sure that I have no changes to accidentally remove or add anything to those folders.

I do not want to change general hard disk folder permissions, just mark data read only for my code runs in Pycharm.

Operation system is Windows 10, Python is 3.X.

1 Answer 1

1

File system is the only one who could set and check permission on files.

PyCharm is unable to track activity of external process (Python interpreter with your script).

Possible solution could be adding that data to version control system, committing and reverting if python script changed something.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for the answer. Unfortunately this does not solve my problem, if I ran the codes from my hard disk. Amount of data is >> free capacity in hard disk.
I have used git as version control system of my codes and I want to keep them separately. But when I think more, I'll need to use file path to the root of the data folder, like: if os.environ['COMPUTERNAME']="my_computer_name": path_name = "E:/my_data_folder". In this way, we can share data separately and the codes with git version control.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.