ASCII & Binary sort (was: sort question )

Bruce G. Barnett barnett at crdgw1.crd.ge.com
Thu May 18 23:19:30 AEST 1989


In article <10289 at smoke.BRL.MIL>, gwyn at smoke (Doug Gywn) writes:

[ re sorting files with ascii and binary data ]

>but there is no widespread UNIX
>convention for binary file structures.

Because such a convention or program would be machine dependent,
and files sorted this way would only be meaningful to machines with
similar architectures.

I also assume that each sorting routine should be optimized
for each architecture, floating point representation, etc.

Let me pose a question. What is the best way to solve this problem?

1. Write a sort routine based on XDR (eXternal Data Representation).
	The binary file would then be portable to other machines
	It wouldn't be very fast - I expect.

2. Write a sort routine that allows you to sort on binary fields.
	The data files would be non-portable. Special applications
	would have to read and write the binary files.

3. Store all information in ASCII format. Use standard UNIX utilities.

4. Write a dedicated C program. Since the application was custom,
   the sort would be too.

5. Use a real database package like Unify, Ingres, Oracle, etc.

6. ?

I personally would use 3 unless I had to make the program faster, and
then I would use 4. Using qsort(3) isn't very difficult to a C
programmer.

Does anyone have any experience of the disadvantages (speed, size) of using
a pure ASCII database?

--
Bruce G. Barnett	<barnett at crdgw1.ge.com>  a.k.a. <barnett@[192.35.44.4]>
			uunet!crdgw1.ge.com!barnett barnett at crdgw1.UUCP



More information about the Comp.unix.questions mailing list