txt: ## canonpath.md
  canonpath
  
  Combined from primary sources listed below.
  
  # [In IO::Spec::Cygwin](#___top "go to top of document")[§](#(IO::Spec::Cygwin)_method_canonpath "direct link")
  
  See primary documentation
  [in context](/type/IO/Spec/Cygwin#method_canonpath)
  for **method canonpath**.
  
  ```raku
  method canonpath(Str() $path, :$parent --> Str:D)
  ```
  
  Returns a string that is a canonical representation of `$path`. If `:$parent` is set to true, will also clean up references to parent directories. **NOTE:** the routine does not access the filesystem.
  
  ```raku
  IO::Spec::Cygwin.canonpath(｢C:\foo\\..\bar\..\ber｣).say;
  # OUTPUT: «C:/foo/../bar/../ber␤»
  
  IO::Spec::Cygwin.canonpath("foo///./../bar/../ber").say;
  # OUTPUT: «foo/../bar/../ber␤»
  
  IO::Spec::Cygwin.canonpath("foo///./../bar/../ber", :parent).say;
  # OUTPUT: «ber␤»
  ```
  
  # [In IO::Spec::Unix](#___top "go to top of document")[§](#(IO::Spec::Unix)_method_canonpath "direct link")
  
  See primary documentation
  [in context](/type/IO/Spec/Unix#method_canonpath)
  for **method canonpath**.
  
  ```raku
  method canonpath(Str() $path, :$parent --> Str:D)
  ```
  
  Returns a string that is a canonical representation of `$path`. If `:$parent` is set to true, will also clean up references to parent directories. **NOTE:** the routine does not access the filesystem, so no symlinks are followed.
  
  ```raku
  IO::Spec::Unix.canonpath("foo//../bar/../ber").say;
  # OUTPUT: «foo/../bar/../ber␤»
  
  IO::Spec::Unix.canonpath("foo///./../bar/../ber").say;
  # OUTPUT: «foo/../bar/../ber␤»
  
  IO::Spec::Unix.canonpath("foo///./../bar/../ber", :parent).say;
  # OUTPUT: «ber␤»
  ```
  
  # [In IO::Spec::Win32](#___top "go to top of document")[§](#(IO::Spec::Win32)_method_canonpath "direct link")
  
  See primary documentation
  [in context](/type/IO/Spec/Win32#method_canonpath)
  for **method canonpath**.
  
  ```raku
  method canonpath(Str() $path, :$parent --> Str:D)
  ```
  
  Returns a string that is a canonical representation of `$path`. If `:$parent` is set to true, will also clean up references to parent directories. **NOTE:** the routine does not access the filesystem.
  
  ```raku
  IO::Spec::Win32.canonpath("C:/foo//../bar/../ber").say;
  # OUTPUT: «C:\foo\..\bar\..\ber␤»
  
  IO::Spec::Win32.canonpath("C:/foo///./../bar/../ber").say;
  # OUTPUT: «C:\foo\..\bar\..\ber␤»
  
  IO::Spec::Win32.canonpath("C:/foo///./../bar/../ber", :parent).say;
  # OUTPUT: «C:\ber␤»
  ```
  
  # [In IO::Spec::QNX](#___top "go to top of document")[§](#(IO::Spec::QNX)_method_canonpath "direct link")
  
  See primary documentation
  [in context](/type/IO/Spec/QNX#method_canonpath)
  for **method canonpath**.
  
  ```raku
  method canonpath(Str() $path, :$parent --> Str:D)
  ```
  
  Returns a string that is a canonical representation of `$path`. If `:$parent` is set to true, will also clean up references to parent directories. **NOTE:** the routine does not access the filesystem, so no symlinks are followed.
  
  ```raku
  IO::Spec::QNX.canonpath("foo//../bar/../ber").say;
  # OUTPUT: «foo/../bar/../ber␤»
  
  IO::Spec::QNX.canonpath("foo///./../bar/../ber").say;
  # OUTPUT: «foo/../bar/../ber␤»
  
  IO::Spec::QNX.canonpath("foo///./../bar/../ber", :parent).say;
  # OUTPUT: «ber␤»
  ```
  