CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Is it safe to change owner of src to root? (https://www.cfd-online.com/Forums/openfoam-programming-development/130122-safe-change-owner-src-root.html)

chrisb2244 February 20, 2014 02:40

Is it safe to change owner of src to root?
 
So essentially I have myself a nice working copy of OF-2.2.2
I'm writing my own applications and libraries in my OpenFOAM/user-2.2.2/... directories, and all is well.
I'm referring to the original source files in OpenFOAM/OpenFOAM-2.2.2/src/... directories.

My question is, whilst I have these open in an editor to refer to, sometimes I make changes to the original /src files, which I don't want to do, and accidentally save them. Usually I notice, undo the changes, and save them again, but I'm worried I might change the source files, save them, and not notice. Now until I wmake in the src directories, this won't change my installation (right?) and so shouldn't matter, but it does mean that I might later be referring to source files which are not as they originally were.

Is it safe to type
Code:

cd src
sudo chown -R root *

such that then the directories under the src directory have permissions like (viewed via ls -l)
Code:

-rwxr-xr-x  1 root christian 2057 10月  3 19:28 Allwmake
drwxr-xr-x 13 root christian 4096 11月 20 15:32 combustionModels
drwxr-xr-x  9 root christian 4096 11月 20 15:25 conversion
drwxr-xr-x  6 root christian 4096 10月  3 19:28 dummyThirdParty
drwxr-xr-x 11 root christian 4096 11月 20 15:26 dynamicFvMesh
drwxr-xr-x 22 root christian 4096 11月 20 15:25 dynamicMesh
...


dkxls February 20, 2014 06:54

Shouldn't be a problem. I have a global installation in
Code:

/opt/openfoam/OpenFOAM-2.2.x
and all directories/files are owned by root with permissions for directories like this
Code:

-rwxr-xr-x  1 root root 2057 Feb 18 16:09 Allwmake
drwxr-xr-x 13 root root 4096 Feb 18 18:44 combustionModels
drwxr-xr-x  9 root root 4096 Feb 18 20:51 conversion
drwxr-xr-x  6 root root 4096 Feb 18 20:51 dummyThirdParty
drwxr-xr-x 11 root root 4096 Feb 18 18:26 dynamicFvMesh
drwxr-xr-x 22 root root 4096 Feb 18 18:24 dynamicMesh                                                                               
...

and files like this
Code:

-rw-r--r-- 1 root root 11601 Feb 18 16:09 basicThermo.C
-rw-r--r-- 1 root root 47217 Feb 18 18:29 basicThermo.dep
-rw-r--r-- 1 root root 13079 Feb 18 16:09 basicThermo.H
-rw-r--r-- 1 root root  5944 Feb 18 16:09 basicThermoTemplates.C


dkxls February 20, 2014 06:59

Oh and keep in mind that your files in
Code:

platforms/linux64GccDPOpt/bin/
platforms/linux64GccDPOpt/lib/

need to have the executable bit set like this:
Code:

-rwxr-xr-x 1 root root  80713 Feb 18 19:06 adiabaticFlameT
-rwxr-xr-x 1 root root  821456 Feb 18 19:10 adjointShapeOptimizationFoam
-rwxr-xr-x 1 root root  145485 Feb 18 18:59 ansysToFoam
-rwxr-xr-x 1 root root  606887 Feb 18 19:04 applyBoundaryLayer
-rwxr-xr-x 1 root root  234104 Feb 18 19:04 applyWallFunctionBoundaryConditions
-rwxr-xr-x 1 root root  26827 Feb 18 19:02 attachMesh
-rwxr-xr-x 1 root root  73235 Feb 18 19:02 autoPatch
-rwxr-xr-x 1 root root  98549 Feb 18 18:59 autoRefineMesh
-rwxr-xr-x 1 root root  96535 Feb 18 19:00 blockMesh
...



All times are GMT -4. The time now is 05:22.