WKF2298@RITVAX.ISC.RIT.EDU (Wonko the Sane) (01/05/91)
I just began working on a little programming project that does some copying of files very, very, very effectively just from basic. (May I say that it is actually unbelievably fast in comparison to some market copiers.) My only problem is that there is just no way to specify the aux type of a file from ProDOS. And only in a few cases is this important (oddly enough, copying a BASIC file is one of them!), but I still should make this fully functional. I have a little ML program that I found in a magazine that does it, but I wish to distribute this program to a User's Group and I don't want to risk disaster for using a tiny little (possibly) copyrighted routine. I would just be very happy if anyone had any suggestion as to how I can get around this dilema? How can I change the aux type of a file when I create it? Is there a poke or something? William K. Fry wkf2298@ritvax.isc.rit.edu
marekp@pnet91.cts.com (Marek Pawlowski) (01/05/91)
To do this, use a set_file_info MLI call, and adjust the Aux filetype, and anything else, really, in the Parameter list. /* Marek Pawlowski, marekp@{generic|pnet91|bkj386|torag|aunix}.uucp */ /* President, Intelligent Twist Software, 250 Harding Blvd, PO BOX 32017 */ /* Richmond Hill, Ontario, L4C 9M7, CANADA. An ideal route is as follows: */ /* { Ph: (416) 884-4501 4-8pm EDT } generic!pnet91!marekp@zoo.toronto.edu */
ART100@PSUVM.PSU.EDU ("Andy Tefft 725-1344", 814) (01/07/91)
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.
AABENSON@MTUS5.BITNET (01/08/91)
I've tested it out -- in fact, I'm using it in a program I recently wrote. It all works just fine.