🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4218

Re: Is this a good Idea??

#4218
From: Kent A Vander Velden
Date: Wed, 11 Oct 1995 19:33
26 lines
1511 bytes
In <453cm0$fk5@niflheim.rutgers.edu> jjwright@niflheim.rutgers.edu (John Wright) writes:

>We are trying to create a dataset which will eventually be transferred
>to many different users on many different machines (unix, mac, dos,
>etc).  We plan to create the dataset and a number of routines for
>extracting data from the dataset into various software import formats.

>The question is this, I am going to be programming in ANSI C.  I want
>to read and write the files in binary format.  Every variable or
>number that I write to the file is between 0 and 255 (one byte).  I
>plan to write all the variables (characters and integers) as
>characters with a simple fprintf statement.  We will then make the
>datasets and the ANSI C routines available to others who will
>retrieved them over the internet.  

  What about byte order problems?  Do such problems come up with
characters?  Couldn't a person use ntohs() and htons() to solve these
byte order problems that might occur in the file?

  I think I would look at read()/write() or fread()/fwrite() instead of
fprintf();


-- 
Kent Vander Velden
graphix@iastate.edu
Technical Details
Message-ID: <graphix.813439983@sdg.cc.iastate.edu>
Path: arc1-ca.pugleaf.net!sdg.cc.iastate.edu!graphix
References: <453cm0$fk5@niflheim.rutgers.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sdg.cc.iastate.edu!graphix
From: graphix@iastate.edu (Kent A Vander Velden)
Newsgroups: comp.std.c
Subject: Re: Is this a good Idea??
Date: 11 Oct 95 19:33:03 GMT
Organization: Iowa State University, Ames, Iowa
Message-ID: <graphix.813439983@sdg.cc.iastate.edu>
References: <453cm0$fk5@niflheim.rutgers.edu>
NNTP-Posting-Host: sdg.cc.iastate.edu