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
directory
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.
Bob
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils