Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!apple!farrier From: farrier@Apple.COM (Cary Farrier) Newsgroups: comp.sys.apple Subject: Re: A few IIGS programming questions Message-ID: <33512@apple.Apple.COM> Date: 27 Jul 89 15:39:49 GMT References: <10294@boulder.Colorado.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 65 In article <10294@boulder.Colorado.EDU> hartkopf@tramp.Colorado.EDU (HARTKOPF JEFFREY M) writes: >1) How can you lock/unlock files from a IIGS desktop application? Destroy() >returns an error if I attempt to use it on a locked file. From a desktop application, such as the Finder, you can select the icon of the file, then choose "Icon Info" under the "Special" menu, and it will bring up information about the file. In the upper right hand portion of the information window is a check box called "Locked". You can change the locked status of the file by toggling the check box (an "X" in the check box means that the file is locked). As for not being able to Destroy() a file: Each file on a ProDOS volume has an access attribute, which is a word value and is defined as follows: bits 15-8 reserved, must be zero bit 7 0 = destroy disabled, 1 = destroy enabled bit 6 0 = rename disabled, 1 = rename enabled bit 5 0 = backup not needed, 1 = backup needed bits 4-3 reserved, must be zero bit 2 0 = file is visible, 1 = file is invisible bit 1 0 = write disabled, 1 = write enabled bit 0 0 = read disabled, 1 = read enabled What you want to do is set the access parameter of the file so that bit 7 is a 1, thus enabling you to destroy the file. Another reason that you may not be able to destroy the file is if it is currently open. >2) What is the format for the createDate, createTime, modDate, and modTime >fields of some of the ProDOS 16 records? The createDate and modDate parameters are both words and follow this format: bits 15-9 year (1=1901, 2=1902,...) bits 8-5 month (1=January, 2=February,...) bits 4-0 day of month (1,2,...,31) So if you wanted to represent July 27th, 1989, you would use the following binary value: 1011001011111011 or in hex: B2FB, decimal 45819. The createTime and modTime parameters are also word values and follow this format: bits 15-13 0 bits 12-8 hour (0-23) bits 7-6 0 bits 5-0 minute (0-59) So if you wanted to represent the time 8:41 (notice that the time is expressed using a 24 hour clock), you would use the binary value of %0000100000101001, hex $0829, decimal 2089. Cary Farrier +------------------------------------+ | #include "All.Standard.Disclaimers"| +------------------------------------+