Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!pequod.cso.uiuc.edu!dorner From: dorner@pequod.cso.uiuc.edu (Steve Dorner) Newsgroups: comp.sys.mac.programmer Subject: Re: stdio, THINK C and APPLs Message-ID: <1991Jan8.160431.3537@ux1.cso.uiuc.edu> Date: 8 Jan 91 16:04:31 GMT References: <640.2783DEFA@busker.fidonet.org> <1991Jan7.224021.9163@svc.portal.com> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at U-C Lines: 37 In article <1991Jan7.224021.9163@svc.portal.com> daven@svc.portal.com writes: >Well that hardly keeps within the spirit of portable C code, which is what >I thought the moaning was all about. If you modify FOpen to have a new >mode, then it's hardly portable. MPW C gives printf a new descriptor (%P); do you consider this evil? >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. >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'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? -- Steve Dorner, U of Illinois Computing Services Office Internet: s-dorner@uiuc.edu UUCP: uunet!uiucuxc!uiuc.edu!s-dorner