bug-fileutils
[Top][All Lists]
Advanced

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

Re: fileutils 4.1: tests/ls/follow-slink


From: Jim Meyering
Subject: Re: fileutils 4.1: tests/ls/follow-slink
Date: Wed, 04 Dec 2002 20:22:17 +0100

Richard Dawe <address@hidden> wrote:
> Hello.
>
> I'm trying to work out how tests/ls/follow-slink from fileutils 4.1 can
> pass/fail, in particular the command:
>
>     ls -L link 2> /dev/null && fail=1
>
> This dereferences the link 'link'. It seems this 'ls' command is expected to
> fail - presumably because the link is cyclic and some function will return
> ELOOP.
>
> 'link' is a cyclic symlink created like this:
>
>     ln -s link link || framework_failure=1
>
> In the DJGPP port of 'ln', this does nothing. No symlink is created - this is
> due to the DJGPP libc implementation of symlink(). So the 'ls -L' command
> fails and the test passes.

Thanks for the explanation.
If the DJGPP libc implementation of symlink really
works that way, then shouldn't it be fixed?

> Perhaps the test should do something like this?
>
>     ln -s link link || framework_failure=1
>     test -f link || framework_failure=1

That wouldn't work, since `test -f link' would fail even on
a unix-based system.  But this should detect the failure you describe:

      ls link || framework_failure=1

What version of DJGPP has this problem?

Jim




reply via email to

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