Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: SFGetFolder Message-ID: <36464@apple.Apple.COM> Date: 14 Nov 89 16:22:31 GMT References: <709@maytag.waterloo.edu> <9741@zodiac.ADS.COM> Organization: Apple Computer Inc, Cupertino, CA Lines: 35 In article <9741@zodiac.ADS.COM> jtn@ads.com (John Nelson) writes: >In article <709@maytag.waterloo.edu> jb@aries5.UUCP () writes: >>Has anybody written a SFGetFolder/SFPutFolder routine -- What I want to be >> able to do is select or create a folder in a nice manner. >> >>The problem that I have with the implementations that I have seen of >>selecting a folder i.e. 'Set Transfer Directory...' MacDTS has released a sample program that shows you how to do this, among other tricks with StdFile. You can get this from APDA, BBS's and finer FTP sites everywhere, including ours. Basically, it involves writing a file filter procedure that always returns TRUE. Here is the relevant code: FUNCTION FoldersOnly(p:ParmBlkPtr):BOOLEAN; { Normally, folders are ALWAYS shown, and aren't even passed to } { this file filter for judgement. Under such circumstances, it is } { only necessary to blindly return TRUE (allow no files whatsoever). } { However, Standard File is not documented in such a manner, and } { this feature may not be TRUE in the future. Therefore, we DO check } { to see if the entry passed to us describes a file or a directory. } BEGIN FoldersOnly := TRUE; IF BTst(p^.ioFlAttrib,4) THEN FoldersOnly := FALSE; END; Hope this helps, -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions