[Top][All Lists]

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

Re: confusing error message from ln

From: Bob Proulx
Subject: Re: confusing error message from ln
Date: Sun, 30 Oct 2005 13:58:16 -0700
User-agent: Mutt/1.5.9i

Paul Eggert wrote:
> How about this patch?  I think it addresses all issues raised so far
> on this thread.

> +       ? (errno != ENAMETOOLONG && *source
> +          ? _("creating symbolic link %s")
> +          : _("creating symbolic link %s to %s"))

With that patch applied I now have this output:

  touch foo
  ./ln -s foo /nonexistent/path
  ./ln: creating symbolic link `/nonexistent/path': No such file or directory

Good.  And the code for that after the changes is still simple so I
like it.  I would like to see that change made.

But the hard link case is much more complicated than before.  And
unfortunately does not cover the main case.

> +       : (errno == EMLINK && !source_is_dir
> +          ? _("creating hard link to %.0s%s")
> +          : (errno == EDQUOT || errno == EEXIST || errno == ENOSPC
> +             || errno == EROFS)
> +          ? _("creating hard link %s")
> +          : _("creating hard link %s to %s"))),

  ./ln foo /nonexistent/path
  ./ln: creating hard link `/nonexistent/path' to `foo': No such file or 

The ENOENT case is not specifically listed as a short entry.  So I
don't think this part really improves things.  Unless there is some
way to make this list also very short like the symlink side is then I
would probably leave the original there.

> -       : _("creating hard link %s to %s")),

I like the way the symlink code path checks one specific thing and
just divides the errors on that.  But this looks like doing this for
the hard link side is more complicated and would not be conducive to
future maintainability.

  ENOENT -- No such file or directory
  EDQUOT -- Quota exceeded
  EEXIST -- File exists
  ENOSPC -- No space left on device
  EROFS  -- Read-only file system

Worried that list is still not all encompassing and not all of them
would be supported everywhere and that type of thing.  Maybe this is a
sleeping dog to be left to sleep.


reply via email to

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