Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!julius.cs.uiuc.edu!wuarchive!uunet!blkcat!f421.n109.z1.fidonet.org!Ken.Knight From: Ken.Knight@f421.n109.z1.fidonet.org (Ken Knight) Newsgroups: comp.sys.mac.programmer Subject: Re: Help With File Manager Message-ID: <3087.2794333E@blkcat.fidonet.org> Date: 16 Jan 91 01:10:15 GMT Sender: ufgate@blkcat.fidonet.org (newsout1.26) Organization: FidoNet node 1:109/421 - The Twilight Clone, Paul Heller Lines: 46 lasky@iris.ucdavis.EDU (Ty Lasky) Asks: >1. If I am using SFGetFile to allow the user to select a file, then I >believe I have the name and the volume reference number (or is it the >working directory ID?). Now, how do I get the volume name? SFGetFile() gives you a volume reference number. What you then need is the working directory ID which you can get with a call to GetWDInfo(). Like this: err = GetWDInfo(0,&(reply.vRefNum),&dirID,&procID); if (err == noErr) { err = HOpen(reply.vRefNum,dirId,reply.fName,permission,refNum); .... /* Permission is the read/write access to want for the file. */ .... /* do you thing. */ } All these routines are documented in tech note #218. >3. Assuming that I have a volume name, file name, and working >directory >ID, how do I then set the volume to that volume, and then set to the >correct directory? I know how to use SetVol to set the directory, and >right after calls to SFGetFile and SFPutFile, but I can't seem to set >the default directory to one on another drive in a simple test >program. I don't have the hard answer for this one. However, Apple DTS has some source code out there that should be of use to you. It shows you how to change current default directories and I think that is what you want. >4. Inside Mac, and other references, keep saying that routines like >GetVol return either the volume name OR the directory name. Which is >it? >Under what circumstances? This is really not clear to me. Is it >something to do with MFS vs. HFS? Routines like GetVol vary what they return depending on how you fill in that annoying parameter block. I'd suggest you you the high level routines I mentioned above that are described in Technote #218. Hope that helps. ** Ken ** -- Ken Knight, Ken.Knight@f421.n109.z1.fidonet.org via The Black Cat's Shack's FidoNet<->Usenet Gateway blkcat.fidonet.org and Fidonet 1:109/401