Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!unmvax!uokmax!d.cs.okstate.edu!minich From: minich@d.cs.okstate.edu (Robert Minich) Newsgroups: comp.sys.mac.programmer Subject: Re: stdio, THINK C and APPLs Message-ID: <1991Jan8.184102.16520@d.cs.okstate.edu> Date: 8 Jan 91 18:41:02 GMT References: <1991Jan8.160431.3537@ux1.cso.uiuc.edu> Organization: Oklahoma State University Lines: 55 by dorner@pequod.cso.uiuc.edu (Steve Dorner): | MPW C gives printf a new descriptor (%P); do you consider this evil? | No, but then again, programming on the Mac tends to throw you a lot more Pascal strrings than bare resource forks. :-) |>Opening a resource fork is a Mac OS specific function, and does not make |>sense on any other machine. Thus, use the Mac OS call to do this, that's |>what it's there for. | | You are right that portability is not the issue here. Making life easier | for C programmers is the issue here. The mac file manager is a complete mess | [c'mon: dirid's, vref's, wdnums, PMSP, the PB calls (which you HAVE to | use if you want to open a file with other than read/write permission)], | and the less the novice HAS to know about it the better. I still don't understand the need to much with the resource fork via stdio calls. Are you really that hard pressed to write that little bit (really, it's not THAT bad!) to read from the resource fork? |>Additionally, there's two ways to open a resource a |>resource - one as a just a plain file (dangerous!, very dangerous! unless |>you're planning on copying another entire resource fork over the one you |>just opened) | | Every single application that saves files should use this call. When | you save a file, you write a new one, delete the old and rename the new. | You should also copy the resource fork, in case there are tab/font settings | or other interesting information (window position, maybe) in it. | | How many of you hate apps that don't preserve the resource fork? I think your use of "save" is not clear. Do you mean "Save As..." on on open file or "Save" on a new or pre-existing file? If the former, I wouldn't worry about it too much since that's not a a Mac application. :-| If your talking about a plain "Save" on a pre-existing file, why do you have to go through the delete/rename motions? Just flat out copy the new data directly into the original file, after ensuring it will be able to save (Diskspace check.) | I'm not sure this is worth arguing about. I'm just irked that such an | innocuous TRIVIAL and convenient extension isn't made. Again, I point | you to "%P", which is of much the same nature. (Rich tells me that %P | is gone from THINK C; that's too bad.) Or "\p" in strings. Care to | remove that for the sake of ANSI compatibility? | -- If this is so trivial, then go ahead and do it yourself. If I recall corectly, you use THINK C, so you have the stdio source code. :-p -- |_ /| | Robert Minich | |\'o.O' | Oklahoma State University| "I'm not discouraging others from using |=(___)= | minich@d.cs.okstate.edu | their power of the pen, but mine will | U | - "Ackphtth" | continue to do the crossword." M. Ho