txt: ## catpath.md
  catpath
  
  Combined from primary sources listed below.
  
  # [In IO::Spec::Cygwin](#___top "go to top of document")[§](#(IO::Spec::Cygwin)_method_catpath "direct link")
  
  See primary documentation
  [in context](/type/IO/Spec/Cygwin#method_catpath)
  for **method catpath**.
  
  ```raku
  method catpath (Str:D $volume, Str:D $dir, Str:D $file --> Str:D)
  ```
  
  Same as [`IO::Spec::Win32.catpath`](/type/IO/Spec/Win32#method_catpath), except will also change all backslashes to slashes at the end:
  
  ```raku
  IO::Spec::Cygwin.catpath('C:', '/some/dir', 'foo.txt').say;
  # OUTPUT: «C:/some/dir/foo.txt␤»
  
  IO::Spec::Cygwin.catpath('C:', '/some/dir', '').say;
  # OUTPUT: «C:/some/dir␤»
  
  IO::Spec::Cygwin.catpath('', '/some/dir', 'foo.txt').say;
  # OUTPUT: «/some/dir/foo.txt␤»
  
  IO::Spec::Cygwin.catpath('E:', '', 'foo.txt').say;
  # OUTPUT: «E:foo.txt␤»
  ```
  
  # [In IO::Spec::Unix](#___top "go to top of document")[§](#(IO::Spec::Unix)_method_catpath "direct link")
  
  See primary documentation
  [in context](/type/IO/Spec/Unix#method_catpath)
  for **method catpath**.
  
  ```raku
  method catpath ($, Str:D $part1, Str:D $part2 --> Str:D)
  ```
  
  Takes two path fragments and concatenates them, adding or removing a path separator, if necessary. The first argument is ignored (it exists to maintain consistent interface with other [`IO::Spec`](/type/IO/Spec) types for systems that have volumes).
  
  ```raku
  IO::Spec::Unix.catpath($, 'some/dir', 'and/more').say;
  # OUTPUT: «some/dir/and/more␤»
  ```
  
  # [In IO::Spec::Win32](#___top "go to top of document")[§](#(IO::Spec::Win32)_method_catpath "direct link")
  
  See primary documentation
  [in context](/type/IO/Spec/Win32#method_catpath)
  for **method catpath**.
  
  ```raku
  method catpath (Str:D $volume, Str:D $dir, Str:D $file --> Str:D)
  ```
  
  Concatenates a path from given volume, a chain of directories, and file. An empty string can be given for any of the three arguments. No attempt to make the path canonical is made. Use [`canonpath`](/routine/canonpath) for that purpose.
  
  ```raku
  IO::Spec::Win32.catpath('C:', '/some/dir', 'foo.txt').say;
  # OUTPUT: «C:/some/dir\foo.txt␤»
  
  IO::Spec::Win32.catpath('C:', '/some/dir', '').say;
  # OUTPUT: «C:/some/dir␤»
  
  IO::Spec::Win32.catpath('', '/some/dir', 'foo.txt').say;
  # OUTPUT: «/some/dir\foo.txt␤»
  
  IO::Spec::Win32.catpath('E:', '', 'foo.txt').say;
  # OUTPUT: «E:foo.txt␤»
  ```
  