help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File truncated at ^Z character in windows


From: Eli Zaretskii
Subject: Re: File truncated at ^Z character in windows
Date: Sat, 14 Feb 2004 13:52:29 +0200

> From: John Russell <jorussel@cisco.com>
> Newsgroups: gnu.emacs.help
> Date: 13 Feb 2004 16:03:04 -0500
> 
> Does anyone know what is special about the ^Z character that makes
> the file end like that?

The ^Z character is a kind of ``software end-of-file'' on DOS and
Windows systems.  This is a legacy from the old CP/M family of
operating systems, which was a predecessor of DOS and Windows.  Many
text-oriented programs on Windows, like the notorious Notepad, still
keep this back compatibility.  Text-mode I/O functions in standard
libraries available on Windows signal EOF when they see ^Z, and
console I/O does the same when you write text in cooked mode to the
shell window.

To avoid this truncation, don't use text-mode I/O when you copy files
from Unix to Windows.  For example, if you use FTP to copy files,
issue the `binary' command before the `get' command.  When using other
methods of copying files, prefer good ports of GNU software that will
DTRT and copy the entire file regardless.  For example, instead of
making a zip file, make a tar file, then untar it on Windows using a
port of GNU Tar.

If the above doesn't help, please describe how you copied the
offending file(s), and you will probably get specific advice for that
situation.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]