Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Directory size function: problem with iteration



Hi Lawrence. As a quick test, maybe you could try a sample routine I posted to the list some time ago:

http://www.cocoabuilder.com/archive/message/cocoa/2005/5/20/136503

See if that exhibits the same problem or not. Is it possible that your iterator is hitting a special file of some type? E.g. a symbolic link or something? Where the item fails in the iteration may be important.

Let me suggest that if you want people to look at your code to help you find a problem, you will get better results the easier you make it for them to do so. I hesitatingly downloaded your link, but it's not even in the form of a buildable Xcode project. If I can't reproduce the problem easily I'm not going to look at it. Ideally, you should isolate the problem enough that you can paste in a few lines of code with a good explanation of what's going on. People just don't have a lot of time to do a full review of your sources.

Daniel

On Oct 27, 2005, at 6:46 PM, Lawrence Sanbourne wrote:

Hi,

With some folks from Cocoa-dev, I have a function that successfully
returns the size of directories -- well, most of them.

The function now works great on the directories I originally tested it
on, but it fails when I try to get the directory size of other
directories, such as / or /Users/ls (my home directory). The error is
errFSNotAFolder
(-1407), and it occurs when it is trying to recursively get the
directory size for the FSRefs it has stored in the CFMutableArray.
I've looked at this for a long time and can't find anything. If you
get a spare moment, it would be great if you could take a look and tell me what
might be wrong. I haven't been able to find anything in
common with the files it fails on, but they all appear at least one
level deep in the recursion.


You'll also see in the attachment a Cocoa interface to this class.
Don't get scared by it, Carbon folks. ;-)

Larry

<DirectorySize.zip>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/jalkut%40red- sweater.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Directory size function: problem with iteration (From: Lawrence Sanbourne <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.