getWorkingDirectory/changeWorkingDirectory
Benjamin Franksen
benjamin.franksen at helmholtz-berlin.de
Wed Dec 4 13:38:44 UTC 2013
Module System.Posix.Directory of the unix package defines
getWorkingDirectory :: IO FilePath
changeWorkingDirectory :: FilePath -> IO ()
I believe the functionality is quite portable and not limited to unix-like
systems. I know that e.g. Windows has chdir and getcwd. Module Filesystem of
the system-fileio package has
getWorkingDirectory :: IO FilePath
setWorkingDirectory :: FilePath -> IO ()
I propose to add these functions to System.Environmant or maybe
System.Directory.
Rationale:
(1) This is standard functionality that should at least be in the Haskell
Platform, if not in the standard libraries.
(2) I would like to avoid depending on an extra package just to have these
two very basic functions available in a OS independent way.
(3) "system-fileio".Filesystem does not seem to be the right place for this.
The last point may be arguable, but the first two are plain common sense
IMO.
Cheers
Ben
--
"Make it so they have to reboot after every typo." ? Scott Adams
More information about the Haskell-prime
mailing list