let add_extension path ext =
    match List.rev path with
      Component str :: tl ->
        List.rev ( Component (str^"."^ext) :: tl )
    | _ ->
      raise FilePathNoExtension