I try to achieve something that I imagined very simple, but which is finally harder than expected.
I have a folder : source/
. I have a second one : target/
. I create a file test.jar
in my first folder. Then, I want this file to appear and be executable in my second folder. I see 3 options :
manually copy/paste my file. It works but... I don't want to do it each time I update my file.
symbolic link. It works, but if I execute the jar file, the context is
source/
and nottarget/
like I would like.hard link. That's exactly what I need, but the issue is that
test.jar
is not modified, but generated. This means that after erasingsource/test.jar
,target.test.jar
still references the old file... Is it possible to force the 2 files to have always the same value ?
Thanks for your help !
EDIT : For now, I solved the problem by adding a line to copy my file from source/ to target/ inside a script that I will execute anyway after generating the jar. I think that what I wanted to do is actually impossible. It would need a new kind of linking which links the content of 2 files given their pathname and not their inode...