Thank you for any help...
Michael Kroh
Open the file in Binary and check if any of the first, say 255
characters, are not printable, i.e in the range {0:6;14:31}
If not in range, assume the file is binary, else it's probably text.
--
Thoralf
Private: mailto:thor...@online.no http://home.sol.no/~thoralfn/
At-Work: mailto:th...@atex.no http://www.atex.no
My reply-address is made-up to avoid junk-mail, please use the address
above!
Other people may have other rules, but generally a text file is one which does
not contain any characters outside the range ASCII 32 to ASCII 127 (with the
possible exception of ASCII 9, the Tab character). Therefore, open the file
for binary, read the whole file into a string variable (or read it in in
chunks if it's too large for a single variable) and use Instr to examine the
bytes in the variable to see if you find any characters outside the range.
Lee Weiner
weiner AT fuse DOT net
>if text do one thing, if binary do another, etc.
If binary, you must exactly know how to handle the contents of the file.
This obviously includes the knowledge about the structure of the file, so
you'll easily find out how to answer your question ;-)
DoDi
As I recall, most binary files contain ASC(0) characters whereas pure text
files normally do not.