From benjamin.franksen at helmholtz-berlin.de Wed Dec 4 13:38:44 2013 From: benjamin.franksen at helmholtz-berlin.de (Benjamin Franksen) Date: Wed, 04 Dec 2013 14:38:44 +0100 Subject: getWorkingDirectory/changeWorkingDirectory Message-ID: 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 From chrisdone at gmail.com Wed Dec 4 14:18:49 2013 From: chrisdone at gmail.com (Christopher Done) Date: Wed, 4 Dec 2013 15:18:49 +0100 Subject: getWorkingDirectory/changeWorkingDirectory In-Reply-To: References: Message-ID: How does it differ to getCurrentDirectory/setCurrentDirectory in System.Directory? On 4 December 2013 14:38, Benjamin Franksen < benjamin.franksen at 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 at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-prime > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Dec 4 14:19:48 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 4 Dec 2013 09:19:48 -0500 Subject: getWorkingDirectory/changeWorkingDirectory In-Reply-To: References: Message-ID: On Wed, Dec 4, 2013 at 8:38 AM, Benjamin Franksen < benjamin.franksen at 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 at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.franksen at online.de Wed Dec 4 19:37:03 2013 From: ben.franksen at online.de (Ben Franksen) Date: Wed, 04 Dec 2013 20:37:03 +0100 Subject: getWorkingDirectory/changeWorkingDirectory References: Message-ID: 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 at . 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