• 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
NSDirectoryEnumerator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDirectoryEnumerator


  • Subject: NSDirectoryEnumerator
  • From: Brian Amerige <email@hidden>
  • Date: Tue, 15 Aug 2006 15:54:48 -0400

I'm trying to use an NSDirectoryEnumerator to recursively delete a directory via FTP.

'dir' is the path to the selected folder.

NSFileManager *manager = [NSFileManager defaultManager];
NSDirectoryEnumerator *dirEnum = [manager enumeratorAtPath:dir];
id object;
while (object = [dirEnum nextObject])
{
//File or folder?
if(![[object substringToIndex:1] isEqualToString:@"."])
{
if([[[dir stringByAppendingPathComponent:object] pathExtension] isEqualToString:@""])
{
[ftp deleteDirectory:object];
}
else
{
[ftp deleteFile:object];
}
}
}

It doesn't seem to even get into the while loop, any ideas why?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSDirectoryEnumerator
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Xcode/gcc help in enforcing secure coding?
  • Next by Date: Xcode 2.4: Different behavior of MAC_OS_X_VERSION_MAX_ALLOWED ?
  • Previous by thread: Re: Xcode 2.4 bug fixes?
  • Next by thread: Re: NSDirectoryEnumerator
  • Index(es):
    • Date
    • Thread