Re: CRLF fun stuff again...


Subject: Re: CRLF fun stuff again...
From: Duncan Sinclair (sinclair@dis.strath.ac.uk)
Date: Fri Feb 02 2001 - 08:23:42 EST


Hi,

Jeremy writes:
>Hello,
> I have just installed netatalk 1.4b2 and cannot get it to do the
>CRLF->LF translation when copying files from a Mac to my Linux machine.

> ...

>The files I copy over are text files with the .txt extension generated by
>Visual FoxPro (FOXX). Any ideas?

This is (as far as I'm concerned) the single biggest bug in netatalk.

The problem is that the cr/lf translation only happens when netatalk
sees that the file is text before it is written. Unfortunately, since
MacOS 8, the Finder doesn't set the file type to TEXT until after the
copy is finished. Thus no cr/lf conversion.

The only way to make this work properly is to re-process files when
their type is changed to "TEXT". There are, of course, big gotchas
over this, like the Mac might expect a simple attribute change to
happen in an instant, rather than having to wait for as long as it
takes to re-write the text file.

Here's my proposed solution:
  * A second "helper" process would run along side the main afpd process,
    tied to it with pipes.
  * tasks would be handed to it like "do a cr/lf translation of this file".
  * it would have to take care to lock files.
  * tasks are done serially - to make sure nothing gets screwed.
  * there may be other types of thing it could be used for.

This would not be a trivial amount of code.

Every time I have had a few spare hours to look at this I'm been scared
away by the complexity of the afpd code. I don't think I'll have
sufficient time to actually write any code to do this in the forseeable
future.

Until now, every time I mention this problem, people tell me that I
shouldn't want to do cr/lf translation, and it's an ugly hack. My reply
is that it is necessary for cross platform file manipulation, and I
really, actually, want it, thank you very much.

I now hope that someone will email me back saying that this is fixed in
the latest beta version. (please!)

Cheers,

Duncan.



This archive was generated by hypermail 2b28 : Sun Oct 14 2001 - 03:04:31 EDT