Why use U* over VMS
D'Arcy J.M. Cain
darcy at druid.uucp
Thu Nov 1 01:19:54 AEST 1990
In article <1089 at dg.dg.com> uunet!dg!lewine writes:
> [...]
> In UNIX it is not possible to support anything but flat ASCII
> files without special code in the application. That is why
> most UNIX systems have only flat ASCII files. This may be fine
> for software engineering but it is not what the Data Processing
> world wants.
>
I can't speak for everyone who programs in Unix but in my case I started
programming using fixed length records in C. By that I mean to get record
'rec_num' I would do something like this:
#define ASSUME_APPROPRIATE_ERROR_CHECKING
typedef {
int something;
char something_else[32];
...
} S_TYPE;
S_TYPE s_buf;
...
fseek(fp, rec_num * sizeof(S_TYPE), SEEK_SET);
fread(s_buf, sizeof(S_TYPE), 1, fp);
This worked very well. It was quick and relatively simple to program.
As I moved to Unix however I started to move away from this model and
started using the flat ASCII line delimited model. The reason for this
was data portability. Sed, awk, grep etc. can now work on my files.
It is no longer necessary for every program that works on a data file
to know the internals of the program that created it.
I guess what I am saying is that you may have the cart before the horse
here. Unix programmers like the flat ASCII model because the nature of
the file system promotes this sort of data sharing. If somehow files
could only be read by programs written specifically for them I think
you would see much different, and perhaps more efficient, ways of storing
data under Unix.
>These are only my humble opinions.
Me too.
--
D'Arcy J.M. Cain (darcy at druid) |
D'Arcy Cain Consulting | I support gun control.
West Hill, Ontario, Canada | Let's start with the government!
+ 416 281 6094 |
More information about the Comp.unix.programmer
mailing list