Re: EOF location?
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxx>
- Date: Sun, 28 May 2006 20:07:43 +1200
"Rick Smith" <ricksmith@xxxxxxx> wrote in message
news:127ihcv1n0jub63@xxxxxxxxxxxxxxxxxxxxx
"Pete Dashwood" <dashwood@xxxxxxxxxxxxxx> wrote in message
news:4dsr45F1bi54rU1@xxxxxxxxxxxxxxxxx
the
"HeyBub" <heybubNOSPAM@xxxxxxxxx> wrote in message
news:127hfdman9s836f@xxxxxxxxxxxxxxxxxxxxx
Anyone know where the EOF is supposed to be located on a PC file?
Er...please sir! please sir!... at the END of the file, sir!
In other words, if Windows reports a file is, say, 100 bytes long, is
thisEOF (X'1A') supposed to be in the 100th or 101st byte?
I did a quick experiment using a DOS box....
Here's the results... (I have added comments for those who were not born
when the only option was a command line interface...these comments (as
is a COBOL forum) are prefixed with *>input.
================== start of DOS box ===============
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
*> Create a simple text file with the characters 1 thru 8...
C:\Documents and Settings\dashwood>echo 12345678 > testfile.txt
*> Make sure that textfile.txt DOES contain the expected characters...
C:\Documents and Settings\dashwood>type testfile.txt
12345678
*> Get a directory report on the file...
C:\Documents and Settings\dashwood>dir testfile.txt
Volume in drive C is PetesP4system
Volume Serial Number is D499-5305
Directory of C:\Documents and Settings\dashwood
28/05/2006 17:07 11 testfile.txt
1 File(s) 11 bytes
0 Dir(s) 10,042,187,776 bytes free
It would appear that there are three more characters than we actually
ARE
Windows reports the file as 11 bytes; yet only 8 characters were input...
Looks like a job for Hex Editor...(AXE version 3 ...)
31 32 33 34 35 36 37 38 20 0d 0a
Aha! NINE characters were input; I inadvertently entered a space... (x20)
So, the answer to your question:
YES, the two characters which indicate EOF (in the Windows environment)
included in the file size reported by the Operating System. Your Hex 1FEOF
is incorrect for a text file (possibly COBOL uses a different EOF, but I
doubt it); it is x'0D' x'0A' and both these characters ARE INCLUDED in
the
size reported by the OS.
So that settles it?
Try using, copy con: testfile.txt.Copying a console stream (or an existing file) is NOT the same thing at all.
After typing the numbers 1 through 8, press F6 then Enter.
On Windows 98SE, I get 8 characters in the file.
The COPY command will only duplicate EXACTLY what it gets (this can be
modified by the various options to the command, but the default is an exact
duplication of whatever is in operand 1). If there is no EOF marker then it
won't be copied or created on the output. That is why I chose to use ECHO
and redirect the output from it.
What does F6 do?
As to it being settled, that is for HeyBub to decide. If he's using Win 98
SE he may be very interested in your results.
Pete.
.
- Follow-Ups:
- Re: EOF location?
- From: Rick Smith
- Re: EOF location?
- References:
- EOF location?
- From: HeyBub
- Re: EOF location?
- From: Pete Dashwood
- Re: EOF location?
- From: Rick Smith
- EOF location?
- Prev by Date: Re: EOF location?
- Next by Date: Re: EOF location?
- Previous by thread: Re: EOF location?
- Next by thread: Re: EOF location?
- Index(es):
Relevant Pages
|
|