Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!yoyo.aarnet.edu.au!sirius.ucs.adelaide.edu.au!adam.adelaide.edu.au!phil From: phil@adam.adelaide.edu.au (Phil Kernick) Newsgroups: comp.sys.amiga.programmer Subject: Re: Question About FileInfoBlock Structures Keywords: FileInfoBlock directories dos amigados Message-ID: Date: 5 Feb 91 23:09:54 GMT References: <18a052ee.ARN02d3@aquarium.buffalo.ny.us> Sender: news@ucs.adelaide.edu.au Organization: University of Adelaide, South Australia Lines: 50 Nntp-Posting-Host: adam.adelaide.edu.au ernie@aquarium.buffalo.ny.us (Ernest J. Gainey III) writes: >Hello Everyone, > I'm curious if anyone knows why this little bit of code produces such > a strange result, from what I can tell, it should do a directory > listing filename, filesize, and protections... > Problem is... the fib_Protection field of the FileInfoBlock structure > is Empty... when I print it as a "%d", i get a 0... all the other fields > appear to have values... but do a... > printf("Protection==%d\n",MyFileInfoBlock->fib_Protection); > and I get a: Protection==0 ... This one bit me too. The answer is as follows... Protection bits Sense --------------- ----- R 0 W 0 E 0 D 0 A 1 P 1 S 1 H 1 This means that if fib_Protection returns 0 then the file has: ----RWED If it had fib_Protection == 0xff then the file has: HSPA---- If it has fib_Protection == 0xf0 then... HSPARWED and fib_Protection == 0x0f then... -------- It seems silly to have some bits active high and others active low, but that is what it turns out to be. Phil. -- o| /// Phil Kernick EMail: phil@adam.adelaide.edu.au |o | /// Departmental Engineer Phone: +618 228 5914 | o| \\\/// Dept. of Psychology Fax: +618 224 0464 |o | \/// University of Adelaide Mail: GPO Box 498 Adelaide SA 5001 |