Article View: comp.sys.amiga.tech
Article #9018Re: Text files
From: doug-merritt
Date: Sat, 04 Jun 1988 19:55
Date: Sat, 04 Jun 1988 19:55
23 lines
1333 bytes
1333 bytes
Sam asks:
>Does anybody know of an algorithm for detecting weather a file is a
>text file or not short of reading the the entire file.
The obvious answer is: see whether the first 512 bytes contain anything
other than ascii graphics (space thru tilde) and whitespace (cr, nl,
backspace, control-L).
If you don't want to read the whole file, don't read the whole file.
Am I misunderstanding your question???
If what you're asking is "does AmigaDOS keep track of file type, so
you could do some magic call and find out that it's a text file for
certain", then the answer is "no".
Unfortunately for those of us who are object-oriented. Or fortunately,
from the point of view of those who hate dealing with Macintosh resource
forks.
Doug
--
Doug Merritt ucbvax!sun.com!cup.portal.com!doug-merritt
or ucbvax!eris!doug (doug@eris.berkeley.edu)
or ucbvax!unisoft!certes!doug
Technical Details
Message-ID:
<6238@cup.portal.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!cbmvax!uunet!portal!cup.portal.com!doug-merrittReferences:
<172@snll-arpagw.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!cbmvax!uunet!portal!cup.portal.com!doug-merritt From: doug-merritt@cup.portal.com Newsgroups: comp.sys.amiga.tech Subject: Re: Text files Message-ID: <6238@cup.portal.com> Date: 4 Jun 88 19:55:19 GMT References: <172@snll-arpagw.UUCP> Organization: The Portal System (TM) Lines: 23 XPortal-User-Id: 1.1001.4407