Monday 30 May 2016

Haskell: makeRelativeToCurrentDirectory: Construct a path relative to current directory


System.Directory module provides makeRelativeToCurrentDirectory function, which construct a path relative to current directory. Following is the signature of makeRelativeToCurrentDirectory function.

Prelude System.Directory> :t makeRelativeToCurrentDirectory 
makeRelativeToCurrentDirectory :: FilePath -> IO FilePath
Prelude System.Directory> getCurrentDirectory 
"/Users/harikrishna_gurram"
Prelude System.Directory> makeRelativeToCurrentDirectory "/Users/harikrishna_gurram"
"."
Prelude System.Directory> makeRelativeToCurrentDirectory "/Users/harikrishna_gurram/Shared"
"Shared"
Prelude System.Directory> makeRelativeToCurrentDirectory "/Users/harikrishna_gurram/Shared/Movies"
"Shared/Movies"
Prelude System.Directory> makeRelativeToCurrentDirectory "/Users/harikrishna_gurram/Shared/Movies/1"
"Shared/Movies/1"


Previous                                                 Next                                                 Home

No comments:

Post a Comment