getWorkingDirectory/changeWorkingDirectory

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

How does it differ to getCurrentDirectory/setCurrentDirectory in System.Directory? On 4 December 2013 14:38, Benjamin Franksen < benjamin.franksen@helmholtz-berlin.de> wrote:
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
_______________________________________________ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime

Hi Everyone On Wednesday, December 04, 2013 09:19:48 Brandon Allbery wrote:
The functionality is similar but different, insofar as Windows still has legacy drive paths and the current directory is maintained separately for each one; I would expect this to be exposed in a Windows version.
Right. Forgot that.
That said, there are already setCurrentDirectory and getCurrentDirectory in System.Directory for portable versions.
On Wednesday, December 04, 2013 15:18:49 Christopher Done wrote:
How does it differ to getCurrentDirectory/setCurrentDirectory in System.Directory?
I have just been stupid and did not see them. Also, I *thought* I was sending this message to libraries@, not haskell-prime@. Seems this is not my day. Sorry for the noise & thank you for your patience Cheers Ben -- "Make it so they have to reboot after every typo." -- Scott Adams

On Wed, Dec 4, 2013 at 8:38 AM, Benjamin Franksen < benjamin.franksen@helmholtz-berlin.de> wrote:
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
The functionality is similar but different, insofar as Windows still has legacy drive paths and the current directory is maintained separately for each one; I would expect this to be exposed in a Windows version. That said, there are already setCurrentDirectory and getCurrentDirectory in System.Directory for portable versions. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (4)
-
Ben Franksen
-
Benjamin Franksen
-
Brandon Allbery
-
Christopher Done