Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!dartvax!news From: Jim.Matthews@dartmouth.edu (Jim Matthews) Newsgroups: comp.sys.mac.comm Subject: Re: New XferIt Mac FTP Client Available Message-ID: <1991Apr30.172718.11744@dartvax.dartmouth.edu> Date: 30 Apr 91 17:27:18 GMT References: <1991Apr30.121736.10695@ux1.cso.uiuc.edu> Sender: news@dartvax.dartmouth.edu (The News Manager) Reply-To: Jim.Matthews@dartmouth.edu (Jim Matthews) Organization: Dartmouth Software Development Lines: 94 MacTCP apps will have to be rewritten, or at least relinked; there's no getting around the fact that MacTCP now belongs in the Control Panels folder, and existing apps will not look there. Requiring two copies of MacTCP is a kludge that users shouldn't have to put up with. In that spirit, here's my rewrite of the offending routine in dnr.c. It looks in the Control Panels folder first, then in the regular system folder, and is not fooled by aliases (but it doesn't resolve them either). It requires the MPW 3.2 Interface.o (or Think C 4.0.4 MacTraps) for the Gestalt glue; otherwise it only works under 6.0.4 and later. And it requires 7.0 interfaces (from either the 7.0b1 CD or the 7.0b4 CD) for the definitions of the Gestalt and Folder manager constants. Hopefully Apple and Symantec will make the new interfaces and libraries available for FTP once 7.0 ships. Enjoy, Jim Matthews Dartmouth Software Development --- short OpenOurRF() { SysEnvRec info; HParamBlockRec fi; Str255 filename; long gestalt_response; short refnum; OSErr osstat; osstat = Gestalt(gestaltFindFolderAttr, &gestalt_response); if ((osstat == noErr) && (gestalt_response & (1 << gestaltFindFolderPresent))) { short cp_vref; long cp_dirid; /* the folder manager is there -- ask about the Control Panels folder */ osstat = FindFolder(kOnSystemDisk, kControlPanelFolderType, kDontCreateFolder, &cp_vref, &cp_dirid); if (osstat == noErr) { fi.fileParam.ioCompletion = nil; fi.fileParam.ioNamePtr = (StringPtr) &filename; fi.fileParam.ioVRefNum = cp_vref; fi.fileParam.ioDirID = cp_dirid; fi.fileParam.ioFDirIndex = 1; while (PBHGetFInfo(&fi, false) == noErr) { /* scan system folder for driver resource files of specific type & creator */ if (fi.fileParam.ioFlFndrInfo.fdType == 'cdev' && fi.fileParam.ioFlFndrInfo.fdCreator == 'mtcp') { /* found the MacTCP driver file? */ refnum = HOpenResFile(cp_vref, cp_dirid, (StringPtr) StripAddress(&filename), fsRdPerm); if (GetIndResource('dnrp', 1) == NULL) CloseResFile(refnum); else return refnum; } /* check next file in system folder */ fi.fileParam.ioFDirIndex++; fi.fileParam.ioDirID = cp_dirid; } } /* Found Control Panels folder */ } /* Folder Manager there */ SysEnvirons(1, &info); fi.fileParam.ioCompletion = nil; fi.fileParam.ioNamePtr = &filename; fi.fileParam.ioVRefNum = info.sysVRefNum; fi.fileParam.ioDirID = 0; fi.fileParam.ioFDirIndex = 1; while (PBHGetFInfo(&fi, false) == noErr) { /* scan system folder for driver resource files of specific type & creator */ if (fi.fileParam.ioFlFndrInfo.fdType == 'cdev' && fi.fileParam.ioFlFndrInfo.fdCreator == 'mtcp') { /* found the MacTCP driver file? */ refnum = OpenRFPerm((StringPtr) StripAddress(&filename), info.sysVRefNum, fsRdPerm); if (GetIndResource('dnrp', 1) == NULL) CloseResFile(refnum); else return refnum; } /* check next file in system folder */ fi.fileParam.ioFDirIndex++; fi.fileParam.ioDirID = 0; } return(-1); }