Skip to content

Commit 6812cbb

Browse files
rnjtranjanharendra-kumar
authored andcommitted
Add RealPath module
1 parent a66207c commit 6812cbb

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
@@ -118,6 +118,7 @@ library
118118
, Streamly.Coreutils.FileTest
119119
, Streamly.Coreutils.Ls
120120
, Streamly.Coreutils.String
121+
, Streamly.Coreutils.RealPath
121122
, Streamly.Coreutils.ShellWords
122123
, Streamly.Coreutils.Sleep
123124
, Streamly.Coreutils.Uniq

0 commit comments

Comments
 (0)