Subject: Re: CR/LF and CR question

From: [email-masked] (Geoff Terry Systems & Net supt 064 923677)
Date: Thu, 22 May 1997 09:35:10 +1000 (EST)

AT a guess I would say they dont use ftp, they see the Novell fs as just a
network share/volume.
No problems if you use the same OS to read the files as that which generated
them in the first place.
Why not create a temporary store (on the Novell server - not the unix mount
point) that the clients deposit into. Then have a cron job which establishes
an ftp sesion with the novell server and moves everything in the temp store
into the unix mounted Novell share. That way the the conversion should get done.

Geofft
>
>DOS uses CR/LF, Macs use CR, and Unix uses LF as end of line characters. 
>If people are using FTP to transfer the files to the FTP server, just use
>TEXT or ASCII mode to transfer the files and the conversion should be
>handled automatically.  If they can just copy over what they have created,
>about your only option that I know of is to post process the files to fix
>the CR and CR/LF issues. 
>
>   -- Michael
>
>On Wed, 21 May 1997, Greg Whitlock wrote:
>
>> We have some documents being served by wu-ftpd from a partition mounted
>> onto a Unix box from a Novell server.  The users who can put files in
>> these space on the Novell server can use whatever they want to to create
>> the files (ie, a Mac, etc).
>> 
>> Here's the problem:  Some files get created with just line feeds (LF) at
>> the end of each line and some get created with carriage return/line feeds
>> (CR/LF).  When you access these files via an ftp URL the files with just
>> LF's are displayed as one long line while the files with CR/LF are double
>> spaced.  Bizarre.
>
>
>
Geoff Terry    Systems & Network Support
ACR Net        Sapphire Coast NSW 2550
Australia
Ph 064 923677  Mobile 015 668 227 Fax 064 924594

---

From: [email-masked] (Geoff Terry Systems & Net supt 064 923677)
Date: Thu, 22 May 1997 09:46:36 +1000 (EST)

Or you could write a little sh script which calls a C program to filter all
the files periodically.

here's c code to convert the Mac files to Unix (uses stdin)

int
main()
{
        int     c;

        while ((c = getchar()) != -1) {
                if (c == '\r') c = '\n';
                putchar(c);
        }
} 

Just write a sh script to cat & pipe the file to this (executable) and
output to the original file.
You can augment it to handle dos files as well.

Geofft

Geofft