Module FilenameExtra.Extra (.ml)


module Extra: sig .. end
Extra definitions.

val add_extension_if_absent : string -> string -> string
add_extension_if_absent filename ext append to the string filename the extension ext but only if the filename has no already an extension. This operation just works on strings and doesn't modify anything in the filesystem.

Example:

# add_extension_if_absent "foo" "txt";;
  : string = "foo.txt"

# add_extension_if_absent "foo.c" "txt";;
  : string = "foo.c"