Search code examples
linuxgnu-makeln

Symlinks lifecycle in progress of application


I am wondering about symlinks lifecycle. For exmaple: I have directory:

/home/username/some_program_src

I make symlink:

ln -s /home/username/some_program_src /home/username/src

Then I will compile it:

make

And in progress of this operation I will change symlink to some other similar directory:

rm /home/username/src && ln -s /home/username/some_program_src2 /home/username/src

Will symlink be saved in context of "make" program or it will be replaced hot?


Solution

  • Indeed it was very stupid question, because if file or folder (including symlinks) is blocked by reading and still in progress of reading linux will cache it for application (or somebody in this folder). Also in case if I will start compiling in folder by symlink it will finish compilation in folder by old symlink. If I will run make using path to folder for compilation I would say that behaviour is undefined but looks like make finishes compilation as intended.