Treatment composition

fs/path::composition


Inputs

⇥ path: Stream<string>

Outputs

↦ extension: Stream<Option<string>>
↦ file_name: Stream<Option<string>>
↦ file_stem: Stream<Option<string>>
↦ parent: Stream<Option<string>>


Gives compition of paths.

For each streamed path, the outputs are filled with values:

  • extension contains the part of the name after last ., else is none;
  • file_name contains the full name of the file (bin for /usr/bin/, bar.txt for foo/bar.txt, etc for etc/./, empty for /);
  • file_stem contains the part of the name before last ., or full name if starting with . with none in, or not containing any . at all;
  • parent contains the path up to the parent of the designated component, else is empty (/usr for /usr/bin, empty for /).