Skip to content

Commit e062159

Browse files
committed
Add RealPath module
1 parent b1e6fc3 commit e062159

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Streamly/Coreutils/RealPath.hs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- |
2+
-- Module : Streamly.Coreutils.RealPath
3+
-- Copyright : (c) 2022 Composewell Technologies
4+
-- License : BSD-3-Clause
5+
-- Maintainer : [email protected]
6+
-- Stability : experimental
7+
-- Portability : GHC
8+
--
9+
-- Returns resolved symbolic link target.
10+
11+
module Streamly.Coreutils.RealPath
12+
(realPath)
13+
where
14+
15+
import System.Directory (canonicalizePath )
16+
17+
-- | Make a path absolute, normalize the path,
18+
-- and remove as many indirections from it as possible.
19+
20+
realPath :: FilePath -> IO FilePath
21+
realPath = canonicalizePath

streamly-coreutils.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ library
9898
, Streamly.Coreutils.Common
9999
, Streamly.Coreutils.Cp
100100
, Streamly.Coreutils.FileTest
101+
, Streamly.Coreutils.RealPath
101102
, Streamly.Coreutils.ShellWords
102103
, Streamly.Coreutils.Uniq
103104
, Streamly.Coreutils.Which

0 commit comments

Comments
 (0)