Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!labrea!Portia!Jessica!rick From: rick@Jessica.stanford.edu (Rick Wong) Newsgroups: comp.sys.mac.programmer Subject: Re: i.o. problem with MPW C Keywords: MPW, C Message-ID: <1172@Portia.Stanford.EDU> Date: 28 Mar 89 23:19:18 GMT References: <222@uw-apl.UUCP> Sender: USENET News System Reply-To: rick@Jessica.stanford.edu (Rick Wong) Distribution: na Organization: Stanford University Lines: 24 In article <222@uw-apl.UUCP> keith@uw-apl.UUCP (Keith Kerr) writes: >I've just started using MPW C, and I'm having a problem with >very simple i/o. I've tried several variations of the following >program (which runs fine on UNIX), but without success. The >output file gets created, but upon completion it is either >empty, or unreadable. Any pointers as to what I'm doing >wrong would be helpful. > [simple i/o program deleted] Your program is indeed writing what you expect to the file. The only problem is that the Finder doesn't know it's a text file (and so it appears unreadable to you). All you have to do is execute the following command to the shell after running your program: setfile -t 'TEXT' -c 'MPS ' "your file name" As far as I know, there's no "clean" way to set a file's type from within your program (you have to use some File Manager calls (eeahgghhgh)). Rick Wong Stanford University rick@jessica.stanford.edu