Path: utzoo!attcan!uunet!crdgw1!crdgw1.ge.com!barnett From: barnett@crdgw1.crd.ge.com (Bruce G. Barnett) Newsgroups: comp.unix.questions Subject: ASCII & Binary sort (was: sort question ) Message-ID: <415@crdgw1.crd.ge.com> Date: 18 May 89 13:19:30 GMT References: <199448@hrc.UUCP> <810056@hpsemc.HP.COM> <10289@smoke.BRL.MIL> Sender: news@crdgw1.crd.ge.com Reply-To: barnett@crdgw1.crd.ge.com (Bruce G. Barnett) Organization: GE Corp. R & D, Schenectady, NY Lines: 43 In-reply-to: gwyn@smoke.BRL.MIL (Doug Gywn) In article <10289@smoke.BRL.MIL>, gwyn@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 a.k.a. uunet!crdgw1.ge.com!barnett barnett@crdgw1.UUCP