Return a relative filepath to a file.
The filepath is relative either from the current directory or from an optional start point.
If a string containing URL is provided then it is returned unchanged.
Parameters: |
|
---|---|
Returns: |
|
See also
Examples: |
---|
>>> cf.relpath('/data/archive/file.nc')
'../file.nc'
>>> cf.relpath('/data/archive///file.nc', start='/data')
'archive/file.nc'
>>> cf.relpath('http://data/archive/file.nc')
'http://data/archive/file.nc'