linux - keep hard link connection after erasing a file -
I try to achieve something which I imagined very simple, but which is more difficult than expected.
I have a folder: source /
I have another one: target /
. I create a file test.jar
in my first folder, then I have to show this file and should be executable in my other folder. I see 3 options:
-
Manually copy / paste My files do this work but ... every time I update my file, so do Do not want to. The symbolic link works, but if I execute a jar file, the reference is not
source /
and thetargets /
as I would like. -
Hard link what I really want, but the problem is that
test.jar
is not modified, but generated it means thatsource / test.jar
,target.test.jar
still refers to the old file ... is it always compulsory to implement 2 filesEdit: For now, I solved the problem by adding a line to my file from source / copy / copy inside a script To copy which I will execute after jar and execute it anyway. I guess what I wanted to do was really impossible, it would require a new kind of link which is the content of 2 files that is given their path name and does not insode them.
Do not create a soft link to the file. Make a soft link to the entire folder.
Something like that
ln -s {whatever path} / source / {whatever path} / target
>(Local) and checkout sources / targets in the folder.
Comments
Post a Comment