The os.Path class / os.Path methods |
Returns all components of a path excluding the last one.
os.Path.dirName( filename STRING) RETURNING result STRING
This method removes the last component of a path provided as argument.
For example, if you pass "/root/dir1/file.ext" as the parameter, it will return "/root/dir1".
See Example 1: Extracting the parts of a file name for more examples.