Skip to content

Commit

Permalink
Add RealPath module
Browse files Browse the repository at this point in the history
  • Loading branch information
rnjtranjan committed Jul 13, 2022
1 parent b1e6fc3 commit e062159
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Streamly/Coreutils/RealPath.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- |
-- Module : Streamly.Coreutils.RealPath
-- Copyright : (c) 2022 Composewell Technologies
-- License : BSD-3-Clause
-- Maintainer : [email protected]
-- 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
1 change: 1 addition & 0 deletions streamly-coreutils.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ library
, Streamly.Coreutils.Common
, Streamly.Coreutils.Cp
, Streamly.Coreutils.FileTest
, Streamly.Coreutils.RealPath
, Streamly.Coreutils.ShellWords
, Streamly.Coreutils.Uniq
, Streamly.Coreutils.Which
Expand Down

0 comments on commit e062159

Please sign in to comment.