Skip to content

Commit c40c792

Browse files
rnjtranjanharendra-kumar
authored andcommitted
Add RealPath module
1 parent f9d85b4 commit c40c792

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

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 : streamly@composewell.com
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
@@ -130,6 +130,7 @@ library
130130
, Streamly.Coreutils.Mkdir
131131
, Streamly.Coreutils.Mv
132132
, Streamly.Coreutils.ReadLink
133+
, Streamly.Coreutils.RealPath
133134
, Streamly.Coreutils.Rm
134135
, Streamly.Coreutils.Sh
135136
, Streamly.Coreutils.Sleep

0 commit comments

Comments
 (0)