Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jul 2009 08:48:43 -0500
From:      Andrew Gould <andrewlylegould@gmail.com>
To:        Unga <unga888@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to find what symlink points to?
Message-ID:  <d356c5630907270648x265b684fs2436d8ec3a11f986@mail.gmail.com>
In-Reply-To: <771031.86846.qm@web57007.mail.re3.yahoo.com>
References:  <771031.86846.qm@web57007.mail.re3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 27, 2009 at 8:45 AM, Unga<unga888@yahoo.com> wrote:
>
> --- On Mon, 7/27/09, Erik Trulsson <ertr1013@student.uu.se> wrote:
>
>> From: Erik Trulsson <ertr1013@student.uu.se>
>> Subject: Re: How to find what symlink points to?
>> To: "Unga" <unga888@yahoo.com>
>> Cc: freebsd-questions@freebsd.org
>> Date: Monday, July 27, 2009, 9:36 PM
>> On Mon, Jul 27, 2009 at 05:44:59AM
>> -0700, Unga wrote:
>> >
>> > Hi all
>> >
>> > I need to remove some unwanted symlinks on /dev using
>> a C program.
>> >
>> > The "struct dirent" only shows the symlink name, how
>> do I find what that
>> > symlink points to for verification purpose?
>>
>> By using the readlink(2) system call.
>>
>
> But readlink(2) fails with errno set to 2. Can readlink(2) use with dev nodes?
>
> Unga
>

Doesn't 'ls -alh' provide that information?

Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d356c5630907270648x265b684fs2436d8ec3a11f986>