• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: getting only folder from system
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting only folder from system


  • Subject: Re: getting only folder from system
  • From: Chris Espinosa <email@hidden>
  • Date: Sun, 25 Apr 2004 20:46:22 -0700

On Apr 25, 2004, at 6:40 PM, 1h0f?A wrote:

> a part of code below is to get names of all folders under the
> 'rootDir',
> but the result in 'FolderNames,dirRef,and spec' shows not only folders
> but also files.
> Is there any way to get only folder name or to select folder among the
> above results ?
> Thanks.
>
> /////////////////////////////////////////////////
> FSRef           rootDir;
> ItemCount       returnedFolders;
> FSVolumeRefNum  volumeRefNum;
> FSIterator     iterator;
> Boolean containerChanged;
> HFSUniStr255        FolderNames[255];
> FSCatalogInfo       cataInfo[255];
> FSSpec              spec[255];
> FSRef               dirRef[255];
>
> err = FSOpenIterator(&rootDir,kFSIterateFlat,&iterator);    //root Dir
> of volume
> err =
> FSGetCatalogInfoBulk(iterator,100,&returnedFolders,containerChanged,kFS
> C
> atInfoGettableInfo,cataInfo,dirRef,spec,FolderNames);
> /////////////////////////////////////////////////

This is probably more appropriate for the carbon-development list
(http://lists.apple.com/mailman/listinfo/carbon-development) than the
Xcode list as it has to do with use of the Carbon framework rather than
use of development tools.

Putting that aside, you either want to have FSGetCatalogInfoBulk return
the kFSCatInfoNodeFlags, and check them for kFSNodeIsDirectoryMask; or
you might want to use FSCatalogSearch instead, looking only for
directories (though it has the drawback of only allowing you to start a
search at the volume root).

http://developer.apple.com/documentation/Carbon/Reference/File_Manager/
file_manager/function_group_44.html
http://developer.apple.com/documentation/Carbon/Reference/File_Manager/
file_manager/data_type_39.html#//apple_ref/doc/uid/TP30000107/C008654
http://developer.apple.com/documentation/Carbon/Reference/File_Manager/
file_manager/constant_18.html#//apple_ref/doc/uid/TP30000107/C004470

Chris
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >getting only folder from system (From: 김경옥 <email@hidden>)

  • Prev by Date: Can't seem to download first segment of 1.2
  • Next by Date: How to automatically include a nib file from a framework
  • Previous by thread: getting only folder from system
  • Next by thread: Re: Resource forks
  • Index(es):
    • Date
    • Thread