home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!sunic!kth.se!hemul.nada.kth.se!d88-jwa
- From: d88-jwa@hemul.nada.kth.se (Jon WΣtte)
- Subject: Re: Access directory contents
- Message-ID: <1992Nov19.101822.22902@kth.se>
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: hemul.nada.kth.se
- Organization: Royal Institute of Technology, Stockholm, Sweden
- References: <1992Nov16.131617.2096@ncsu.edu> <19385@ucdavis.ucdavis.edu>
- Distribution: comp.sys.mac.programmer
- Date: Thu, 19 Nov 1992 10:18:22 GMT
- Lines: 32
-
- In <19385@ucdavis.ucdavis.edu> cklarson@burrito.engr.ucdavis.edu (Christopher Klaus Larson) writes:
-
- >In article <1992Nov16.131617.2096@ncsu.edu> cpastore@unity.ncsu.edu (Chris Pastore) writes:
- >>
- >>Is there some easy way to get the listing of file names once a
- >>directory is identified?
- >>
-
- >Call PBGetCatInfo on the directory: once with ioFDirIndex negative, to
- >obtain the number of files in the directory; then call it again, once for
- >each value of ioFDirIndex between 1 and the number of files in the
- >directory, inclusive. (I know this explination is not very clear,
- >basically you are performing an indexed search of the directory.)
-
- This is not generally the best way, since files may be added
- or removed while you do it. Instead, just start enumerating
- from 1 and up in indexed mode. Don't give up on the first error,
- it might be a permission error, give up first when you get a fnfErr
- (or was that eofErr?)
-
- Actually, you still might have problems with disappearing files
- (or appearing files) so you might want to go back and check again
- like DIsinfectant does it.
-
- Cheers,
-
- / h+
-
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Suedoise (not french speaking) --
- This signature is kept shorter than 4 lines in the interests of UseNet
- S/N ratio.
-