cf.dirname¶
-
cf.
dirname
(filename)[source]¶ Return the directory name of a file.
If a string containing URL is provided then everything up to, but not including, the last slash (/) is returned.
See also
Examples
>>> cf.dirname('/data/archive/file.nc') '/data/archive' >>> cf.dirname('..//file.nc') '..' >>> cf.dirname('http://data/archive/file.nc') 'http://data/archive'