Creating Read-Only Files in VM
Interested in sharing your data for collaborative research in the workspace, while ensuring that the original data remains unchanged?
Consider generating a read-only file for the data within your workspace VM as a potential solution.
How to create a read-only file:
- Create or upload file to your workspace
- Enter your workspace VM and follow the steps below for windows or linux.
On Windows
To set permissions, from a terminal window, enter
Set-ItemProperty -Path z:\path_to_your_file\file.txt -Name IsReadOnly -Value $trueTo verify permissions are set correctly, enter:
Get-ItemProperty -Path z:\path_to_your_file\file.txt | Select-Object IsReadOnlyOn Linux
Login as sudo:
sudo -iChange the file permissions using chmod:
chmod 444 file.txtRestart the VM, and the permissions should stay.
Note you should not be able to overwrite the file once made read only. However, collaborators can still delete it, so care should be taken to not delete the read-only file.