bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with ln -s


From: Bob Proulx
Subject: Re: Problems with ln -s
Date: Wed, 20 Mar 2002 21:37:36 -0700

> Is there a way to extensively check if a symbolic link has been
> succesful or if there have been  problems in trying to link.

The return code of the ln program will be zero if no errors occurred
and the link creation was successful.  Check the return code.  With
modern shells the following syntax works well.

  if ! ln -s foo bar; then
    echo "Error: Failed to create symlink" 1>&2
    exit 1
  fi

> I have tried the obvious like testing ln -s on text editable files
> and once I alter any of the original or symbolically linked files
> the changes are automatically appear in the other file and vice
> versa.

That does sound like a functioning system.

> Yet I suspect there is some thing wrong with my symbolic
> links.

What makes you suspect that something is wrong?

> Is there any other way to extensively check my symbolic links.

Use 'ls -ldgon' on the symlink and verify the target is what you expect.
Use 'ls -ldLi' which will push through the symlink and verify that the
file works and that 'ls -ldi' on the target of the symlink has the
same inode number.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]