Re: file and record formats
From: Bill Gunshannon (bill_at_cs.uofs.edu)
Date: 01/14/04
- Next message: David J. Dachtera: "Re: To all "patriotic" americans..."
- Previous message: David J. Dachtera: "Re: VMS runs well on HP Superdome"
- In reply to: briggs_at_encompasserve.org: "Re: file and record formats"
- Next in thread: Kaleb Pederson: "Re: file and record formats"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Jan 2004 02:57:23 GMT
In article <EkUjtH96u9K+@eisner.encompasserve.org>,
briggs@encompasserve.org writes:
> In article <bu1lvv$cia25$1@ID-135708.news.uni-berlin.de>, bill@gw5.cs.uofs.edu (Bill Gunshannon) writes:
>> In article <9ZNzQcf2SLnu@eisner.encompasserve.org>,
>> briggs@encompasserve.org writes:
>>> If your Unix diff utility is looking at raw file data then your Unix
>>> diff utility is broken.
>>
>> No more than your hammer is broken if it doesn't properly put in screws.
>> All files in Unix are raw. diff is just the wrong tool if you are trying
>> to compare none Unix Text Files.
>
> No. His diff utility is broken. It's treating a VMS file as a stream of
> bytes. VMS files are not streams of bytes. They are streams of records.
I agree, his diff is broken but that has nothing to do with the Unix diff
command which was designed to compare records in a text file in the format
Unix uses for text files, that means lines of ASCII text termnated with
the newline character. Anything else is not a text file and not food for
the diff command.
>
> The Unix diff utility is an interesting example of a record oriented
> utility acting on a byte stream data source.
All Unix files are byte streams. The only thing that makes a file a
text file is the character set it contains and (assuming it is supposed
to be record oriented) the presence of newline characters.
>
> On VMS, a properly written diff utility should look for record boundaries,
> not newline characters. But if you're going for a simple port, using
> the C RTL and examining the virtual data stream for newlines is a
> reasonable way to proceed. Examining the raw on-disk data for newlines
> is flat wrong.
True also, but that isn't Unix's fault. Using diff to try and compare
binary (non-ASCII) files on a Unix box will also provide some rather
strange results, especially depending on the terminal your using. :-)
bill
-- Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves bill@cs.scranton.edu | and a sheep voting on what's for dinner. University of Scranton | Scranton, Pennsylvania | #include <std.disclaimer.h>
- Next message: David J. Dachtera: "Re: To all "patriotic" americans..."
- Previous message: David J. Dachtera: "Re: VMS runs well on HP Superdome"
- In reply to: briggs_at_encompasserve.org: "Re: file and record formats"
- Next in thread: Kaleb Pederson: "Re: file and record formats"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|