os.Path.extension

The os.Path.extension method is used to return the extension of the file. The syntax of the function is as follows:

 

CALL os.Path.extension(f_name) RETURNING extension

 

where:

·         f_name = a string standing for the file name with its extension after the last dot,

·         extension = a STRING variable containing the part of the f_name following the last dot in it.

 

Usage

 

If no extension is specified in the f_name, the function returns NULL.

Here is an example of the os.Path.extension method calling:

 

#returns "txt"

CALL os.Path.extension ("File_name.txt") RETURNING extension