Re[2]: [Xitami] FTP problem with LF versus CRLF in ASCII files
xitami@lists.xitami.org
xitami@lists.xitami.org
Fri, 13 Dec 2002 16:00:20 -0500
I agree with you completely. But there is my problem : when the "FTP
process "helpfully" translates line-breaks from the
source machine's convention to the destination machine's convention." it
does not. To be more specific Xitami used to but do not anymore.
In this case, the sender is an MVS and the receiver is an NT. The files
have to be transferred in ASCII. If the transfer mode is set to bin I will
get EBCDIC, I tried ! The files used to be received by an older version of
Xitami and they contained CRLF. The latest version of Xitami receives them
with LF. I even tried an ASCII transfer from windows to windows of a file
containing CRLF. After the FTP transfer it was containing LF ! From
windows to windows ! FTP transfer shouldn't do that. Xitami shouldn't do
that.
Guillaume Rompré
|---------+----------------------------->
| | Paul Reid |
| | <preid@rci.rutgers|
| | .edu> |
| | Sent by: |
| | xitami-admin@lists|
| | .xitami.org |
| | |
| | |
| | 2002-12-13 12:45 |
| | Please respond to |
| | xitami |
| | |
|---------+----------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
| |
| To: "guillaume_rompre@ingcanada.com" <xitami@lists.xitami.org> |
| cc: |
| Subject: Re[2]: [Xitami] FTP problem with LF versus CRLF in ASCII files |
>------------------------------------------------------------------------------------------------------------------------------|
> But I still need Xitami to put CRLF instead of LF. How do I change that
?
FTP has two modes: Text and Binary.
In Binary, the file on the server is the same as the file on the
client. Exact copy.
In Text, the FTP process "helpfully" translates line-breaks from the
source machine's convention to the destination machine's convention.
>From your description, you are sending files from DOS(Win) to Unix.
DOS uses CRLF, Unix expects LF, so a Text-mode FTP transfer will
convert the line-breaks.
In any decent FTP client, you can specify the mode before you start
the transfer. command "bin" or "mode bin" on dumb-terminal FTP
programs, a check-box in WS-FTP and MacFetch and other good FTP
clients. If you use MS IE as an FTP client, you probably are stuck
with what MS IE/ Windows thinks is best for you.
FTP servers and clients default to Text mode. In the dumb ones, you
have to remember to set BIN mode before you transfer. Smart ones
have "Auto-Guess" (based on extension or heuristics) and usually you
can set them to default to Binary on ALL transfers.
If I upload from DOS to unix and plan to use vi to edit the file on
the unix box, I'll use the Text Mode. At least back in 1981, the
port of vi that I used was not happy with CRLF files unless I
invoked some options. (I bet that's been improved.)
But in almost all cases, I do all my editing on the DOS/Win box, and
the unix box is just storage. In that case, I use BIN mode, so when
I send the file up and take it back down, it comes back the same.
(In theory FTP Text both up and down will also convert-convert and
come back the same, but often not.) That also avoids thinking about
what files are text: my way, ALL files are "binary" and handled
without translation.
> Please answer my question even if the answer is as dull as :
> "Well, change your ftp server."
Well no, that won't help. ALL standard FTP servers must support Text
mode and default to that. Perhaps you could find one that doesn't.
And perhaps if your FTP server runs on DOS/Win it will keep the same
line-breaks. (Though I think some FTP servers "assume" that
server-stored files should be in unix format.)
I would say: change your Editor (or whatever is saying it "must"
have CRLF). Any decent text editor will swallow any of the
line-break conventions: DOS, unix, Mac, and optionally save in any
of those formats. On Winders I like UltraEdit, though I have used a
1984 DOS text editor.
-PRR
--
Xitami Users Mailing List -- For Xitami support
To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami