chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Platform-specific newline in a string?


From: felix winkelmann
Subject: Re: [Chicken-users] Platform-specific newline in a string?
Date: Sat, 5 Feb 2005 12:07:34 +0100

On Fri, 4 Feb 2005 11:41:55 -0800, Dan Webb <address@hidden> wrote:
> 
> Thanks for the suggestion.  It makes sense that the platform-specific
> conversion of newline should only occur during file I/O.
> 
> So I tried your suggestion, but it still writes just a line-feed
> character to the file.  Here's my code:
> 
> (define write-text-file (lambda (file-name s)
>     (let ([p (open-output-file file-name #:text)])
>         (let ([slen (string-length s)])
>             (do ((i 0 (+ i 1)))
>                 ((= i slen))
>                 (write-char (string-ref s i) p)))
>         (close-output-port p))))
> 
> (write-text-file "foo.h" (sprintf "~A~%" "hello"))
> 

Are you using Cygwin or the native Windows tools?


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]