Path: 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 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