FW: Cross platform file manipulations

Libraries folk: please respond to Kazu's questions. Kazu: there is a standardisation process, for proposing library changes, described here: http://www.haskell.org/haskellwiki/Library_submissions Simon -----Original Message----- From: Kazu Yamamoto [mailto:kazu@iij.ad.jp] Sent: 22 July 2010 03:38 To: Simon Peyton-Jones Subject: Cross platform file manipulations Hello Simon, I have posted this to Haskell cafe but I did not have good responses. So, I need your suggestion. I'm converting my Ruby script to Haskell. I found several problems of Haskell which does not exist in another script languages: - getModificationTime exists in System.Directory. But getAccessTime, getStatusChangeTime, getCreationTime do not exist. - getModificationTime returns obsoleted type, ClockTime. It should return modern type, UTCTime, I believe. - Path separator is not unified. Even though Windows accepts '/' as a file separator, getCurrentDirectory in System.Directory returns '\\' as a file separator. So, we need to specify regular expression like this: "[/\\]foo[/\\]bar[/\\]baz". - getHomeDirectory returns HOMEDRIVE/HOMEPATH instead of the HOME environment variable on Windows. To fix these portability problems, I'm creating cross platform library to manipulate files: http://github.com/kazu-yamamoto/file Here are questions: 1) I use System.File as module name at this momoent. Is this too radical? Should I use System.EasyFile or System.PortableFile? 2) Are there any standardization process for this? Should I wait for the conclusion before releasing this package? Or can I register the package to hackageDB whenever I like? 3) Do you know other people who are interested in this area? Thanks in advance. --Kazu

Simon Peyton-Jones schrieb:
I'm converting my Ruby script to Haskell. I found several problems of Haskell which does not exist in another script languages:
- getModificationTime exists in System.Directory. But getAccessTime, getStatusChangeTime, getCreationTime do not exist. - getModificationTime returns obsoleted type, ClockTime. It should return modern type, UTCTime, I believe. - Path separator is not unified. Even though Windows accepts '/' as a file separator, getCurrentDirectory in System.Directory returns '\\' as a file separator. So, we need to specify regular expression like this: "[/\\]foo[/\\]bar[/\\]baz".
I think it is intended to have OS specific paths in FilePath values and operate on them with OS specific functions as provided by the 'filepath' package. Sure, an abstract FilePath type would be nice and was discussed from time to time, but did get reality so far.
- getHomeDirectory returns HOMEDRIVE/HOMEPATH instead of the HOME environment variable on Windows.
To fix these portability problems, I'm creating cross platform library to manipulate files:
http://github.com/kazu-yamamoto/file
Here are questions:
1) I use System.File as module name at this momoent. Is this too radical? Should I use System.EasyFile or System.PortableFile?
2) Are there any standardization process for this? Should I wait for the conclusion before releasing this package? Or can I register the package to hackageDB whenever I like?
You may release at Hackage at any time and use package versions in order to track larger changes. http://www.haskell.org/haskellwiki/Package_versioning_policy
3) Do you know other people who are interested in this area?
participants (2)
-
Henning Thielemann
-
Simon Peyton-Jones