document an important property of relPathCwdToFile
This commit is contained in:
parent
9e1a693f16
commit
73f330a62e
1 changed files with 3 additions and 2 deletions
|
@ -64,11 +64,12 @@ absPath file
|
||||||
#endif
|
#endif
|
||||||
return $ absPathFrom cwd file
|
return $ absPathFrom cwd file
|
||||||
|
|
||||||
{- Constructs a relative path from the CWD to a file.
|
{- Constructs the minimal relative path from the CWD to a file.
|
||||||
-
|
-
|
||||||
- For example, assuming CWD is /tmp/foo/bar:
|
- For example, assuming CWD is /tmp/foo/bar:
|
||||||
- relPathCwdToFile "/tmp/foo" == ".."
|
- relPathCwdToFile "/tmp/foo" == ".."
|
||||||
- relPathCwdToFile "/tmp/foo/bar" == ""
|
- relPathCwdToFile "/tmp/foo/bar" == ""
|
||||||
|
- relPathCwdToFile "../bar/baz" == "baz"
|
||||||
-}
|
-}
|
||||||
relPathCwdToFile :: RawFilePath -> IO RawFilePath
|
relPathCwdToFile :: RawFilePath -> IO RawFilePath
|
||||||
relPathCwdToFile f = do
|
relPathCwdToFile f = do
|
||||||
|
@ -79,7 +80,7 @@ relPathCwdToFile f = do
|
||||||
#endif
|
#endif
|
||||||
relPathDirToFile c f
|
relPathDirToFile c f
|
||||||
|
|
||||||
{- Constructs a relative path from a directory to a file. -}
|
{- Constructs a minimal relative path from a directory to a file. -}
|
||||||
relPathDirToFile :: RawFilePath -> RawFilePath -> IO RawFilePath
|
relPathDirToFile :: RawFilePath -> RawFilePath -> IO RawFilePath
|
||||||
relPathDirToFile from to = relPathDirToFileAbs <$> absPath from <*> absPath to
|
relPathDirToFile from to = relPathDirToFileAbs <$> absPath from <*> absPath to
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue