Re: [racket] Question about open-output-file

2010-12-05 Thread Michael Coppola
Thanks Noel and YC for your quick replies. I'm testing out your code, YC, and it seems like it's exactly what I need. I wasn't aware of bzlib/os, so that was really helpful. Thank you! MC On 12/05/2010 04:11 AM, YC wrote: > Another approach is to read the port in line by line via read-line > w

Re: [racket] Question about open-output-file

2010-12-05 Thread YC
Another approach is to read the port in line by line via read-line with 'any, which removes the line terminator for you, and then you can add the os-specific line terminator, below shows how to do so with +:windows. (require (planet bzlib/os)) ;; use +:windows to specify os-based branching (defin

Re: [racket] Question about open-output-file

2010-12-05 Thread Noel Welsh
My guess is the LF in the source is being converted to CRLF, and indeed this is what the docs state. I think doing a regexp-replace* directly on the port is probably the easiest and most efficient thing to do. HTH, N. On Sun, Dec 5, 2010 at 8:01 AM, Michael Coppola wrote: > Hi everyone, > > I am

[racket] Question about open-output-file

2010-12-05 Thread Michael Coppola
Hi everyone, I am using the function "open-output-file" in conjunction with "copy-port" to take incoming data from a TCP port and write it to a file, but I am running into an issue. In my code, I offer the user the option of saving the file by means of "binary" or "ASCII," the first meaning that