[patch] libstdc++/67173 Fix filesystem::canonical for Solaris 10.

Jonathan Wakely jwakely@redhat.com
Thu Sep 17 21:29:00 GMT 2015


On 17/09/15 21:25 +0200, Andreas Schwab wrote:
>Jonathan Wakely <jwakely@redhat.com> writes:
>
>> +  p = "/dev/stdin";
>> +  if (exists(p))
>> +    {
>> +      auto p2 = canonical(p);
>> +      if (is_symlink(p))
>> +        VERIFY( p != p2 );
>> +      else
>> +        VERIFY( p == p2 );
>> +      VERIFY( canonical(p2) == p2 );
>
>This fails if stdin is a pipe, which doesn't have a (real) name, so
>realpath fails.
>
>$ echo | ./canonical.exe
>terminate called after throwing an instance of 'std::experimental::filesystem::v1::__cxx11::filesystem_error'
>  what():  filesystem error: cannot canonicalize: No such file or directory [/dev/stdin]

Ah, of course, the symlink exists but doesn't point to a real file.
Thanks for the explanation.

I'll re-add tests for symlinks when I come up with a proper method for
testing the Filesystem code.




More information about the Libstdc++ mailing list