Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!midway!msuinfo!convex.cl.msu.edu!jap From: jap@convex.cl.msu.edu (Joe Porkka) Newsgroups: comp.sys.amiga.programmer Subject: Re: Question About FileInfoBlock Structures Keywords: FileInfoBlock directories dos amigados Message-ID: <1991Feb4.215450.6140@msuinfo.cl.msu.edu> Date: 4 Feb 91 21:54:50 GMT References: <18a052ee.ARN02d3@aquarium.buffalo.ny.us> Sender: news@msuinfo.cl.msu.edu Organization: Michigan State University Lines: 24 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 ... Thats becuase the RWED bits are inversed. If C:LIST reports that the 'A' and the 'R' flags are set, then in fib_Protection, the bit corresponding to 'a' == 1, and the bit for 'r' ==0. So, try (fib_Protection ^ 0x0f). That is, reinvert the sense of those last bit. The reason this is: The default for protection bits is ----RWED, which cooresponds to fib_Protection==0