Re: Binary or Ascii Text?
- From: SM Ryan <wyrmwif@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 08:51:09 -0000
"Claude Yih" <wing0630@xxxxxxxxx> wrote:
# Hi, everyone. I got a question. How can I identify whether a file is a
# binary file or an ascii text file? For instance, I wrote a piece of
# code and saved as "Test.c". I knew it was an ascii text file. Then
# after compilation, I got a "Test" file and it was a binary executable
# file. The problem is, I know the type of those two files in my mind
# because I executed the process of compilation, but how can I make the
# computer know the type of a given file by writing code in C? Files are
As far as stdio is concerned, a binary file is what you get if you
include a "b" in the open mode, otherwise it's text mode. Binary and
text files may handle end-of-line indicators differently, and how
fseek offsets are interpretted. (In unix, stdio treats binary and
text files identically.)
--
SM Ryan http://www.rawbw.com/~wyrmwif/
GERBILS
GERBILS
GERBILS
.
- References:
- Binary or Ascii Text?
- From: Claude Yih
- Binary or Ascii Text?
- Prev by Date: Re: How to convert image formats?
- Next by Date: Re: Binary or Ascii Text?
- Previous by thread: Re: Binary or Ascii Text?
- Next by thread: Re: Binary or Ascii Text?
- Index(es):
Relevant Pages
|
|