[prev in list] [next in list] [prev in thread] [next in thread]
List: darcs-users
Subject: Re: [darcs-users] Re: windows (was: Subversion vs DARCS...)
From: David Roundy <droundy () jdj5 ! mit ! edu>
Date: 2003-07-08 12:50:34
Message-ID: 20030708125033.GB17882 () jdj5 ! mit ! edu
[Download RAW message or body]
Thanks!
On Tue, Jul 08, 2003 at 02:42:57AM +0200, Peter Strand wrote:
>
> There are three new files:
> Posix-win32.hs, contains a few wrappers for file&time functions
> lock.c, contains take_lock and release_lock from hscurl.c
> External.hs, a Curl.hs replacement, with a slightly different interface
> openUrl and openFileOrUrl are replaced with a
> fetchFile :: String -> IO String
>
> and some small changes to a few other files..
>
> I didn't want to return Handles since I use temporary files which must be
> deleted after they are closed. It might be possible to get around this in
> some way. But returning a String was much simpler to deal with, for now..
Sounds reasonable. The only real advantage of the handles is the ability
to rewind when reading, but since I introduced the FastPackedString I no
longer actually use any rewinding. So I'm for sticking with just returning
a (possibly lazy) String.
> Regarding line-endings, I just added a filter which translates '\r\n' to '\n'
> which makes it possible to fetch files from a windows system to unix
> without problems (for some definitions of problems ;)
> unix -> windows works by default as files are opened in text-mode, and thus
> written with '\r\n' and single '\n':s are understood when reading.
Well, we'll stick with this for the moment. As I've mentioned, I'm
ambivalent on the line endings question, since I don't use windows. As
long as I'm not forced to deal with someone else's '\r':s, I'm fine with
either solution.
It looks like you use the configure script and makefile to compile on
windows? That's nice. It would be nice to make the checking for libcurl a
bit smarter so that if libcurl is available it will be used, and external
commands will be used otherwise. Also, as you mention in a comment (and
gcc helpfully reminds me), we need to switch from tmpname to mkstemp.
Another thought is that I should probably use this code shakeup to organize
the modules a bit more nicely. Locking should be in its own module, for
example. I was getting lazy and adding more and more functions to Curl
which really didn't belong there...
--
David Roundy
http://www.abridgegame.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic