A. Costa wrote:

> >
> > My system has a symlink for a BT878 TV PCI card.  'ls -l'
> > and 'readlink -f' show that symlink, but plain 'realpath' fails
> > and 'realpath -s' returns the symlink target name:
> >
> >     % ls -l /dev/vbidefault
> >     lrwxrwxrwx 1 root video 8 May 15 20:02 /dev/vbidefault -> /dev/vb1

Oh, shouldn't the link point to /dev/vbi1? I don't think /dev/vb1 exists
on your system.

> >
> >     % readlink -f /dev/vbidefault
> >     /dev/vb1
> >
> >     % realpath /dev/vbidefault ; echo $?
> >     /dev/vbidefault: No such file or directory
> >     1


I've just created some link to non-existent file and reproduced your
report, but wouldn't however consider it as a bug. It's an expected
behaviour of realpath, which should fail on missing files.


> >
> >     % realpath -s /dev/vbidefault ; echo $?
> >     /dev/vbidefault
> >     0

The `-s' option only strips duplicated `/' or `/./' and `/../' component
from its argument, but doesn't check if the file exists. In your case,
the argument had no such components, so it was returned without any
changes. See also the 3rd example in realpath(1) man page.


Anyway, many thanks for your bug report and finding the difference
between `readlink -f' and `realpath' I haven't been aware of. I will
document it in man page in the next version of realpath.

Regards,
robert





-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to