diff --git a/src/Streamly/Coreutils/RealPath.hs b/src/Streamly/Coreutils/RealPath.hs new file mode 100644 index 0000000..96da01f --- /dev/null +++ b/src/Streamly/Coreutils/RealPath.hs @@ -0,0 +1,21 @@ +-- | +-- Module : Streamly.Coreutils.RealPath +-- Copyright : (c) 2022 Composewell Technologies +-- License : BSD-3-Clause +-- Maintainer : streamly@composewell.com +-- Stability : experimental +-- Portability : GHC +-- +-- Returns resolved symbolic link target. + +module Streamly.Coreutils.RealPath + (realPath) +where + +import System.Directory (canonicalizePath ) + +-- | Make a path absolute, normalize the path, +-- and remove as many indirections from it as possible. + +realPath :: FilePath -> IO FilePath +realPath = canonicalizePath diff --git a/streamly-coreutils.cabal b/streamly-coreutils.cabal index 934bc75..4906ac6 100644 --- a/streamly-coreutils.cabal +++ b/streamly-coreutils.cabal @@ -118,6 +118,7 @@ library , Streamly.Coreutils.FileTest , Streamly.Coreutils.Ls , Streamly.Coreutils.String + , Streamly.Coreutils.RealPath , Streamly.Coreutils.ShellWords , Streamly.Coreutils.Sleep , Streamly.Coreutils.Uniq