Well, this is untested code as I'm crunching away on some other stuff, 
but try:

foreach line text
[
  print line
  write/append DstFile [line newline] ;HOPEFULLY DOES NOT CRASH HERE!!
]

instead.  Yes it's probably _very_ slow plus the other thing should
never crash REBOL.  That will be looked into.

Sterling

> I'm reposting this, as I've had no takers from the
> previous, and I note that Holger may be monitoring....
> I have tried a couple of different approaches to rewrite a file
> and an FTP site, and the result is always that rebol crashes
> and Dr. Watson intervenes.
> (Current version of view).
> Here's the code, I'd welcome comments.
> ;================================================
> DstFile: ftp://usr:[EMAIL PROTECTED]/log.txt
> SrcFile: ftp://usr:[EMAIL PROTECTED]/log.bak
> text: read/lines DstFile
> if exists? SrcFile [delete SrcFile]
> rename DstFile SrcFile
> ;print type? text
> DstPort: open/new/write DstFile
> foreach line text
> [
>   print line
>   append DstPort [line newline] ;CRASHES HERE!!
> ]
> close DstPort
> 
> ; I am running from a Win NT 4.0 Workstation Platform with upgrade 
> ;  5.0
> ; I am writing to a Linux machine.
> 
> I can make this work if I do the rewrite on my machine and then
> FTP it to the site, but it would be just wonderful if I can do
> the backup and editing at the site.
> 
> TIA
> Tim
> 
> 
> 

Reply via email to