Monday, 30 May 2016

Haskell: getCurrentDirectory: Get current working directory

System.Directory module provides getCurrentDirectory function, which return the absolute path of current working directory.

As per documentation, you may get following error while working with getCurrentDirectory.

Error
Description
HardwareFault
A physical I/O error has occurred.
isDoesNotExistError or NoSuchThing
There is no path referring to the working directory.
isPermissionError or PermissionDenied
The process has insufficient privileges to perform the operation.
ResourceExhausted
Insufficient resources are available to perform the operation.

UnsupportedOperation
The operating system has no notion of current working directory.


Prelude System.Directory> :t getCurrentDirectory
getCurrentDirectory :: IO FilePath
Prelude System.Directory>
Prelude System.Directory> getCurrentDirectory 
"/Users/harikrishna_gurram/"




Previous                                                 Next                                                 Home

No comments:

Post a Comment