Despairy 0 Light Poster

lets say I make a shortcut to a file that exists
ln -s ex7 ex7_shortcut

now I have a C program that checks and finds that ex7_shortcut is a symbolic link
and changes it be placed at "currFolder/links/" ("currFolder/links/ex7_shortcut")

1) how (if possible) can i fix the symbolic link to point to the same file it used to point to?
edit: i know you can recreate the symbolic link, but is there a way fixing the current link?

2) unrelated to 1 : if i find a symbolic link how can i check that it points to an existing file file?

thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.