Jonathan Wakely <jwak...@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]

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to