in reply to Re^2: error handling using symlink
in thread error handling using symlink

cheekuperl,

you're right now. Even though old file doesn't exists, it is creating the symlink which I don't want it. Yes, we can use filetest operations before creating the symlink.

Replies are listed 'Best First'.
Re^4: error handling using symlink
by MidLifeXis (Monsignor) on Jun 18, 2012 at 13:05 UTC

    To follow up on cheekuperl's post, a symlink's target does not need to exist in order to be successfully created. Be aware it is possible that the original file might be changed, deleted, renamed, or otherwise altered between your check and the creation of the symlink, or even any time after you create the symlink. -r (see -X) and company act on the target of the symlink, so that might be another check that you may want to use.

    Symlinks are nice, but just make certain that you are not thinking that they do more than they are designed to do.

    --MidLifeXis