Re: How to distinguish between binary and ASCII file on file opening?
From: Doug Harrison [MVP] (dsh_at_mvps.org)
Date: 08/14/04
- Next message: Doug Harrison [MVP]: "Re: How to distinguish between binary and ASCII file on file opening?"
- Previous message: William DePalo [MVP VC++]: "Re: Windows messages for communication"
- In reply to: CFF: "How to distinguish between binary and ASCII file on file opening?"
- Next in thread: Bill Thompson: "Re: How to distinguish between binary and ASCII file on file opening?"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 14 Aug 2004 14:50:44 -0500
CFF wrote:
>I am writing an applicatioin that will need to distinguish between
>binary and ASCII file to be loaded from hard disk so that different
>processing is applied to different type of file.
>
>Is there any simple way to identify the type of file during the file
>opening process? Thank you.
ASCII is defined on character values 0-127. I think you must mean text file,
in which case, you could search a reasonably long prefix of the file (say,
the first 4-16 KB) for the char value zero, which should not appear in any
text file based on a single byte character set such as ASCII or the Windows
"ANSI".
-- Doug Harrison Microsoft MVP - Visual C++
- Next message: Doug Harrison [MVP]: "Re: How to distinguish between binary and ASCII file on file opening?"
- Previous message: William DePalo [MVP VC++]: "Re: Windows messages for communication"
- In reply to: CFF: "How to distinguish between binary and ASCII file on file opening?"
- Next in thread: Bill Thompson: "Re: How to distinguish between binary and ASCII file on file opening?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|