Re: directoryContentsAtPath freezing computer
Re: directoryContentsAtPath freezing computer
- Subject: Re: directoryContentsAtPath freezing computer
- From: Kevin Wojniak <email@hidden>
- Date: Sun, 7 Dec 2003 20:13:23 -0800
OK I found my problems:
1) I wasn't releasing the attributed string variable a. But this still
didn't fix it so
2) I realized that one folder I was scanning had a file over 400MB and
that held up the program for quite a while
So I just did some checks for file size to make sure I wasn't trying to
read in huge files and it worked!
Kevin
On Dec 7, 2003, at 3:40 PM, Kevin Wojniak wrote:
I am using NSFileManager's directoryContentsAtPath to see if files
inside a folder can be initialized through NSAttributedString.
However, when I go through the loop, some folders freeze up the app
and partially the entire computer. For example, if I use the code with
the pat /Documents it works fine - no freezes or anything. But if I
try to do it with the root volume / it will freeze up pretty bad.
I use this in the tableViewSelectionDidChange notification:
NSArray *files = [[NSFileManager defaultManager]
directoryContentsAtPath:p];
int i, count=0;
for (i=0; i<[files count]; i++) {
NSAttributedString *a = [[NSAttributedString alloc] initWithPath:[p
stringByAppendingPathComponent:[files objectAtIndex:i]]
documentAttributes:nil];
if (a) count++;
}
Any ideas why this would freeze the computer for some directories but
not for others?
Thanks,
Kevin
______
Kevin Wojniak
www.kainjow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
______
Kevin Wojniak
www.kainjow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.