# cf.dirname

`cf.``dirname`(filename)

  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

  `cf.abspath`, `cf.pathjoin`, `cf.relpath`

  Parameters: | filename: `str` The name of the file.
  Returns: | out: `str` The directory name.
  Examples: |

      >>> cf.dirname('/data/archive/file.nc')
      '/data/archive'
      >>> cf.dirname('..//file.nc')
      '..'
      >>> cf.dirname('http://data/archive/file.nc')
      'http://data/archive'