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.
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> cf.dirname('/data/archive/file.nc')
'/data/archive'
>>> cf.dirname('..//file.nc')
'..'
>>> cf.dirname('http://data/archive/file.nc')
'http://data/archive'