Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!PSUVM.PSU.EDU!ART100 From: ART100@PSUVM.PSU.EDU ("Andy Tefft 725-1344", 814) Newsgroups: comp.sys.apple2 Subject: Re: Filetyping in BASIC. . . Message-ID: <9101071544.AA19098@apple.com> Date: 7 Jan 91 15:45:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 80 You could write your own routine in assembly very simply to use the mli get_info and set_info calls: mli = $bf00 org whatever get jmp getinfo set jmp setinfo parms ds 1 ; parm count pathname dw pn ; pathname pointer access ds 1 file_type ds 1 aux_type ds 2 storage_type ds 1 blocks_used ds 2 mod_date ds 2 mod_time ds 2 create_date ds 2 create_time ds 2 err ds 1 ; error storage pn ds 65 getinfo lda #$a sta parms ; sets parm count jsr mli dfb $c4 ; command to do get_info dw parms bne error lda #0 sta err rts setinfo lda #7 sta parms jsr mli dfb $c3 dw parms bne error lda #0 sta err rts error sta err rts ------ To use this, first you would store the file's pathname at "pn" preceded by a length byte. If the first character is a "/", it is treated as the full pathname; if not, any existing prefix is prepended to it. e.g. if the file name is "file", you would store a 4 at pn, followed by the ascii values for "f" "i" "l" and "e." Then you would call "get" to read the file info. The parm list will be filled in, and if there is an error the code will be stored at "err" (otherwise, a 0 will be there). You then go and change any of the values in the parm list you want, and call a "set" to write the parm list back to the directory. I wouldn't change anything besides the filetype, auxtype, and modification date and time. You could change the access byte to lock or unlock the file. Be sure to use a "get" before a "set" to make sure that all the information you are NOT changing remains correct. This might just be small enough to fit in the space at $300. Otherwise you will need to find a space for it. I've set it up so that all the important variables are a constant offset from the program start; i.e. if you assemble it at $2000 (8192 dec). you can call get with a "call 8192," a set with a "call 8192+3," etc. Let me know if you need any more info. I haven't tested the above out, so test it thoroughly on a scratch disk before using.