Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!midway!quads.uchicago.edu!rtp1 From: rtp1@quads.uchicago.edu (raymond thomas pierrehumbert) Newsgroups: comp.sys.mac.programmer Subject: SFPutFile with fopen(...) in c? How? Message-ID: <1990Nov1.205312.13778@midway.uchicago.edu> Date: 1 Nov 90 20:53:12 GMT Sender: news@midway.uchicago.edu (News Administrator) Organization: University of Chicago Lines: 23 Here's a tough one. I have a big c library for munging scientific data files and putting them out in a standard format. It uses the standard c buffered io (fopen, fwrite,fread,fclose). It compiles and works fine on the Mac using Think C. Now I would like to use it in an application, giving the user the chance to specify where (s)he wants to save the output file, using the standard SFPutFile dialog. The problem is, this returns volid and so forth designed to work with FSOpen, FSRead, etc, and not the file pointer that c wants. So I can't figure out how to set the volume/folder I'm writing to. I can use Create to make a mac file in the folder I want, using the output of SFPutFile, but the c fopen(...) call seems to always set the volume/folder to the one from which the application is launched (as far as I can tell). Is there any way to get around this? Given the complexity of the library I am working with it would be impractical to go through and replace all the c io calls with the equivalent Mac File Manager calls. Does fopen really always set the volume/folder the way I think? Is there any kind of SetVol call that would allow me to specify the volume/folder that fopen will use? Please reply via email to rtp1@midway.uchicago.edu .