Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!farrier From: farrier@Apple.COM (Cary Farrier) Newsgroups: comp.sys.apple Subject: Re: GS/OS calls--how? Message-ID: <4716@internal.Apple.COM> Date: 12 Oct 89 23:27:36 GMT References: <12696@boulder.Colorado.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 45 In article <12696@boulder.Colorado.EDU> hartkopf@tramp.Colorado.EDU (Jeff Hartkopf) writes: > >I'm attempting to learn how to use GS/OS calls, and have come up with >some questions. Things don't seem to be working the same way as they did >with the ProDOS 16 calls. > >For example, to get file info on a file, I did something like > [...example deleted...] > >At first I didn't assign anything to the pCount variable and kept >getting errors, so after a little experimentation, I found that 2 seems >to work. But what is the pCount field of most of the GS/OS records for? > >When I did the above, I just seemed to get garbage values for the fileType, >access, auxType, createDateTime, modDateTime, etc., fields. What am I doing >wrong? Do any other fields besides pathname and pCount have to be pre-set >before I call GetFileInfoGS()? The pcount field in the Class 1 GS/OS system calls tells the system how many parameters are in your pblock. The format for the class 1 GET_FILE_INFO call is: $00-$01 pcount $02-$05 input pointer to a class 1 input string containing the pathname $06-$07 access $08-$09 file_type $0A-$0D aux_type ... [and so on...] When you specify a pcount of 2, you are telling the system that you only want to give it the pathname and to receive the file_type. A pcount of 3 will include the aux_type, and so on. Since you only specify a pcount of 2, the FST will not fill in any parameters other than the first two. Note that the pcount does not include pcount itself. Cary Farrier -- +--------------+-------------------------+ | Cary Farrier | farrier@apple.com | +--------------+-------------------------+