Geoff Clare wrote, on 25 Mar 2022:
>
> >     ln -s   /tmp/gibberish/file d/link2
> >     realpath d/link2
> 
> $ realpath d/link2; echo exit $?     
> realpath: d/link2: No such file or directory
> exit 1

I obviously didn't pay enough attention to this result, as the
wording change I proposed doesn't cover it.

I can't see any reasonable way to describe it by reference to
realpath(), so I think we'll need to find a different approach.
Perhaps something along these lines:

    The realpath utility shall recursively expand all symbolic links
    in the pathname specified by the file operand, using the algorithm
    specified in [xref to Pathname Resolution], until one of the
    following conditions is met:

    * The last component of the expanded pathname is found to exist and
      is not a symbolic link.

    * The last component of the expanded pathname is found not to exist
      or its existence cannot be determined.

    * A component of the path prefix of the expanded pathname is found
      not to exist or its existence cannot be determined.  In this case,
      realpath shall write a diagnostic message to standard error and
      exit with a non-zero exit status.

and then have the realpath() "as if" stuff, but passing it the expanded
pathname, or its prefix if -e isn't specified.

Will that work?

-- 
Geoff Clare <[email protected]>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England

            • ... enh via austin-group-l at The Open Group
              • ... Thorsten Glaser via austin-group-l at The Open Group
              • ... enh via austin-group-l at The Open Group
              • ... Thorsten Glaser via austin-group-l at The Open Group
            • ... Robert Elz via austin-group-l at The Open Group
            • ... Geoff Clare via austin-group-l at The Open Group
            • ... Robert Elz via austin-group-l at The Open Group
              • ... Geoff Clare via austin-group-l at The Open Group
              • ... Robert Elz via austin-group-l at The Open Group
              • ... Geoff Clare via austin-group-l at The Open Group
              • ... Geoff Clare via austin-group-l at The Open Group
              • ... Robert Elz via austin-group-l at The Open Group
          • ... Jonathan Wakely via austin-group-l at The Open Group
          • ... Robert Elz via austin-group-l at The Open Group
            • ... Jonathan Wakely via austin-group-l at The Open Group
              • ... Jonathan Wakely via austin-group-l at The Open Group
              • ... G. Branden Robinson via austin-group-l at The Open Group
  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
    • Re: [10... Robert Elz via austin-group-l at The Open Group
      • Re:... Thorsten Glaser via austin-group-l at The Open Group
      • Re:... Robert Elz via austin-group-l at The Open Group

Reply via email to