all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* File truncated at ^Z character in windows
@ 2004-02-13 21:03 John Russell
  2004-02-14  8:43 ` Alan Mackenzie
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: John Russell @ 2004-02-13 21:03 UTC (permalink / raw)


I just moved my all my emacs customization stuff to windows.
Everything seems to work ok except for one thing.

One of the files stops when it sees a ^Z character.

e.g.
Real file part on Linux
...
jde-run) ("[?^C ?^V ?^S]" . speedbar-frame-mode) ("[?^C ?^V ?^W]" . jde-help-symbol) ("[?^C ?^V ?^X]" . jde-show-superclass-source) ("[?^C ?^V ?^Y]" . jde-open-class-at-point) ("[?^C ?^V ?^Z]" . jde-import-find-and-import) ("[?^C ?^V ?e]"
...

File when copied over to Windows.

...jde-run) ("[?^C ?^V ?^S]" . speedbar-frame-mode) ("[?^C ?^V ?^W]" . jde-help-symbol) ("[?^C ?^V ?^X]" . jde-show-superclass-source) ("[?^C ?^V ?^Y]" . jde-open-class-at-point) ("[?^C ?^V ?


And that's it.  That's the end of the file.  Does anyone know what is
special about the ^Z character that makes the file end like that?

note: in this post, I have written ^Z using Shift-6 and Z, but in the
file it is actually one character.

Thanks for the help.

John

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
  2004-02-13 21:03 File truncated at ^Z character in windows John Russell
@ 2004-02-14  8:43 ` Alan Mackenzie
  2004-02-17 19:17   ` John Russell
  2004-02-14 11:52 ` Eli Zaretskii
       [not found] ` <mailman.2383.1076759638.928.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 10+ messages in thread
From: Alan Mackenzie @ 2004-02-14  8:43 UTC (permalink / raw)


John Russell <jorussel@cisco.com> wrote on 13 Feb 2004 16:03:04 -0500:
> I just moved my all my emacs customization stuff to windows.
> Everything seems to work ok except for one thing.

> One of the files stops when it sees a ^Z character.

[ .... ]

> And that's it.  That's the end of the file.  Does anyone know what is
> special about the ^Z character that makes the file end like that?

I seem to remember from my long lost dark ages (~1986) that MS-DOS text
files were expected to end in an End-Of-File character.  Yes, you've
guessed it, ASCII 26, EOF, ^Z.  It was a pain in the posterior even then.

> Thanks for the help.

Two suggestions: (i) write the ^Z as an octal escape sequence, or
something like that;  (ii) move your customization stuff back to a free
system again.  ;-)

> John

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
  2004-02-13 21:03 File truncated at ^Z character in windows John Russell
  2004-02-14  8:43 ` Alan Mackenzie
@ 2004-02-14 11:52 ` Eli Zaretskii
       [not found] ` <mailman.2383.1076759638.928.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2004-02-14 11:52 UTC (permalink / raw)


> 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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
       [not found] ` <mailman.2383.1076759638.928.help-gnu-emacs@gnu.org>
@ 2004-02-17 19:15   ` John Russell
  2004-02-17 20:13     ` Eli Zaretskii
       [not found]     ` <mailman.2587.1077048825.928.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: John Russell @ 2004-02-17 19:15 UTC (permalink / raw)


"Eli Zaretskii" <eliz@elta.co.il> writes:

> > 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?
> 

> 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.

I copied the offending file from a samba share on my linux machine
over to the windows machine.  I didn't open it or edit it with any
editor until NTEmacs opened it.  

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
  2004-02-14  8:43 ` Alan Mackenzie
@ 2004-02-17 19:17   ` John Russell
  0 siblings, 0 replies; 10+ messages in thread
From: John Russell @ 2004-02-17 19:17 UTC (permalink / raw)


Alan Mackenzie<none@example.invalid> writes:

> John Russell <jorussel@cisco.com> wrote on 13 Feb 2004 16:03:04 -0500:
> > I just moved my all my emacs customization stuff to windows.
> > Everything seems to work ok except for one thing.
> 
> > One of the files stops when it sees a ^Z character.
> 
> [ .... ]
> 
> > And that's it.  That's the end of the file.  Does anyone know what is
> > special about the ^Z character that makes the file end like that?
> 
> I seem to remember from my long lost dark ages (~1986) that MS-DOS text
> files were expected to end in an End-Of-File character.  Yes, you've
> guessed it, ASCII 26, EOF, ^Z.  It was a pain in the posterior even then.
> 
> > Thanks for the help.
> 
> Two suggestions: (i) write the ^Z as an octal escape sequence, or
> something like that;  (ii) move your customization stuff back to a free
> system again.  ;-)
> 

True, true, but sometimes it can't be helped, and if I'm going to
have to work on Windows, at least I can have my favorite editor there
to keep me company.  Also, in this case I was using VMware as a  full
system prophylactic, just in case.  While VMware isn't free either,
it still makes me feel better.

John

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
  2004-02-17 19:15   ` John Russell
@ 2004-02-17 20:13     ` Eli Zaretskii
  2004-02-18  8:26       ` Ehud Karni
       [not found]     ` <mailman.2587.1077048825.928.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2004-02-17 20:13 UTC (permalink / raw)


> From: John Russell <jorussel@cisco.com>
> Newsgroups: gnu.emacs.help
> Date: 17 Feb 2004 14:15:12 -0500
> 
> I copied the offending file from a samba share on my linux machine
> over to the windows machine.  I didn't open it or edit it with any
> editor until NTEmacs opened it.  

So it sounds like samba did this.

Anyway, the advice to move the files in an archive, like a tar.gz
file, is still valid, I think.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
  2004-02-17 20:13     ` Eli Zaretskii
@ 2004-02-18  8:26       ` Ehud Karni
  2004-02-18 10:51         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Ehud Karni @ 2004-02-18  8:26 UTC (permalink / raw)
  Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 17 Feb 2004 22:13:18 +0200, Eli Zaretskii <eliz@elta.co.il> wrote:
>
> > From: John Russell <jorussel AT cisco.com>
> > Date: 17 Feb 2004 14:15:12 -0500
> >
> > I copied the offending file from a samba share on my linux machine
> > over to the windows machine.  I didn't open it or edit it with any
> > editor until NTEmacs opened it.
>
> So it sounds like samba did this.

I don't think it is a samba problem. We employ a samba (on GNU/Linux)
with a share of over 50GB and about 200 M$Windows users. It is working
over 3 years and no one reported any such problem.

- From my experience it work just like any M$Windows share.

The only way it can happen is if the copy was a TEXT copy (i.e. not
binary).  The M$Windows `copy' has switches that control its mode:
  /A           Indicates an ASCII text file.
  /B           Indicates a binary file.

> Anyway, the advice to move the files in an archive, like a tar.gz
> file, is still valid, I think.

I think that is because the M$Windows `copy' select the mode (text/
binary) according to the file extension if not specified explicitly.

Ehud.


- --
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQFAMyGdLFvTvpjqOY0RAvnKAJ0fE0Im1u2jdYuXVfLiJX/Y0X30lwCfcIZ0
QHq11DqDKOBokIxd6C5Bbdk=
=f9mi
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
       [not found]     ` <mailman.2587.1077048825.928.help-gnu-emacs@gnu.org>
@ 2004-02-18 10:14       ` Michael M Mason
  2004-02-18 10:36         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Michael M Mason @ 2004-02-18 10:14 UTC (permalink / raw)


On Tue, 17 Feb 2004 22:13:18 +0200, "Eli Zaretskii" <eliz@elta.co.il>
wrote:

>> From: John Russell <jorussel@cisco.com>
>> Newsgroups: gnu.emacs.help
>> Date: 17 Feb 2004 14:15:12 -0500
>> 
>> I copied the offending file from a samba share on my linux machine
>> over to the windows machine.  I didn't open it or edit it with any
>> editor until NTEmacs opened it.  
>
>So it sounds like samba did this.

But the copy operation would have been done by NT, doubtless in text
mode.  I suspect that if the OP renames the offending file so it has,
say, a 'bmp' extension, and then tries the copy operation again, it
would work as expected.

-- 
Michael

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
  2004-02-18 10:14       ` Michael M Mason
@ 2004-02-18 10:36         ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2004-02-18 10:36 UTC (permalink / raw)


> From: Michael M Mason <mmmason@ntlworld.com>
> Newsgroups: gnu.emacs.help
> Date: Wed, 18 Feb 2004 10:14:28 +0000
> 
> But the copy operation would have been done by NT, doubtless in text
> mode.

I doubt that.  File-copy commands on modern Windows systems work in
binary mode by default.  For example, try using the COPY command or
XCOPY.

In any case, copying files in an archive is always a better idea.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: File truncated at ^Z character in windows
  2004-02-18  8:26       ` Ehud Karni
@ 2004-02-18 10:51         ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2004-02-18 10:51 UTC (permalink / raw)


> Date: Wed, 18 Feb 2004 10:26:06 +0200
> From: "Ehud Karni" <ehud@unix.mvs.co.il>
> >
> > So it sounds like samba did this.
> 
> I don't think it is a samba problem. We employ a samba (on GNU/Linux)
> with a share of over 50GB and about 200 M$Windows users. It is working
> over 3 years and no one reported any such problem.

I find it hard to believe, as you do, but given the information
presented in this thread, that was the only conclusion I could draw.
Perhaps we were not told all the facts.

> The only way it can happen is if the copy was a TEXT copy (i.e. not
> binary).  The M$Windows `copy' has switches that control its mode:
>   /A           Indicates an ASCII text file.
>   /B           Indicates a binary file.

True, but the default on modern versions of Windows is binary.

> > Anyway, the advice to move the files in an archive, like a tar.gz
> > file, is still valid, I think.
> 
> I think that is because the M$Windows `copy' select the mode (text/
> binary) according to the file extension if not specified explicitly.

I just tried COPY without any switches with both a .pdf file and a
.txt file, and got binary copies in both cases.  That was on Windows
XP with cmd.exe as the shell (this is important since COPY is a
built-in shell command, so it could behave differently in different
shells).

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-02-18 10:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-13 21:03 File truncated at ^Z character in windows John Russell
2004-02-14  8:43 ` Alan Mackenzie
2004-02-17 19:17   ` John Russell
2004-02-14 11:52 ` Eli Zaretskii
     [not found] ` <mailman.2383.1076759638.928.help-gnu-emacs@gnu.org>
2004-02-17 19:15   ` John Russell
2004-02-17 20:13     ` Eli Zaretskii
2004-02-18  8:26       ` Ehud Karni
2004-02-18 10:51         ` Eli Zaretskii
     [not found]     ` <mailman.2587.1077048825.928.help-gnu-emacs@gnu.org>
2004-02-18 10:14       ` Michael M Mason
2004-02-18 10:36         ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.