in reply to weird kids process, why ?

to my surprise, the chown command in one child process changed the directory in other child process. I did `ls` to the working dir and you can see the directories' owner ship keep chaning.

Yes, that's what happens. File (and directory) permissions and ownerships are properties of the filesystem, which is shared by all processes. If you change the permissions or ownerships on a file (or on a directory), they do not just change for your process(es) only, but for everyone (assuming they change at all -- i.e., assuming you have the permissions needed to make the change). If you change them and then shut the computer down and turn it back on the next day, they'll *still* be whatever you changed them to, even though all of the processes from the previous day are gone, because the file permissions and ownerships are stored on disk, the same as the actual contents of the files are stored on disk.


"In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68

Replies are listed 'Best First'.
Re^2: weird kids process, why ?
by Qiang (Friar) on Jan 11, 2005 at 05:40 UTC
    If you change the permissions or ownerships on a file (or on a directory), they do not just change for your process(es) only, but for everyone
    I don't really follow this. I am trying to change ownership on the target directory recursively. but instead the target directory seems to be exist longer and shared into other process.

    why I am seeing the follwing result within 3 different 'ls' is baffling me.

    drwx------ 3 angelop employee 4096 Jan 10 17:23 aer drwx------ 3 anistasi employee 4096 Jan 10 17:23 aer drwx------ 3 bigdaddy employee 4096 Jan 10 17:23 aer
    thanks for the headup on stat and backtick, thought i am not sure the weridness may result by those but i know i should check the command status.