Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Determinging wheather it is a file or folder

Determinging wheather it is a file or folder
Thread Tools
Senior User
Join Date: Jun 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Jun 20, 2001, 03:16 PM
 
What I am trying to do is build a list of files and folders that reside in a certain folder (the users Favorites folder). What I want to do is build the list so that folder names display with a different name (so the folder "My Files" displays as "My Files-fldr").

I have been able to march down the root folder and get all the files names, but I can't find a way to pick up the folders (my code just skips them...) So any help on determining folders would be great.

Also, is it possible for a carbon app to not display it's icon in the doc? If not (grrr...) how is it done in a cocoa application?
     
Mac Elite
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jun 20, 2001, 11:04 PM
 
From the Foundation documentation for NSFileManager:

- BOOL fileExistsAtPath: (NSString *) path isDirectory: (BOOL *) isDirectory

So, what's the moral of our story? RTFM! Lol, just kidding bud.

[ 06-21-2001: Message edited by: starfleetX ]
The server made a boo boo. (403)
     
Dedicated MacNNer
Join Date: Oct 2000
Location: Pasadena, CA, USA
Status: Offline
Reply With Quote
Jun 21, 2001, 11:26 AM
 
> - BOOL fileExistsAtPath: (NSString *) path isDirectory: (BOOL *) isDirectory

A nice suggestion; there's a similar method in Java (java.io.File.isDirectory() comes to mind.) Except it appears the original poster is writing a Carbon app, not a Cocoa (or Java) application.

I think hs wants IdentifyFolder() (in Folders.h); it'll return an OSErr if dirID points to a file instead of a directory.

Erik
     
Fresh-Faced Recruit
Join Date: Mar 2001
Status: Offline
Reply With Quote
Jun 22, 2001, 11:06 AM
 
yes, an app will not display it's icon in the doc if you make it a faceless. this can be done in resedit.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:23 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2