Re: NSDirectoryEnumerator
Re: NSDirectoryEnumerator
- Subject: Re: NSDirectoryEnumerator
- From: j o a r <email@hidden>
- Date: Tue, 15 Aug 2006 23:13:37 +0200
Hello,
As this question is not related to Xcode or any of the other
development tools, I suggest that you move it to some other mailing
list - for example Cocoa-Dev.
On 15 aug 2006, at 21.54, Brian Amerige wrote:
I'm trying to use an NSDirectoryEnumerator to recursively delete a
directory via FTP.
I'm not sure if it has changed in recent versions of Mac OS X, but
the FTP file system in Mac OS X used to be read only:
<http://docs.info.apple.com/article.html?artnum=107415>
But perhaps you're using some other way of communicating with the FTP
server?
It doesn't seem to even get into the while loop, any ideas why?
That is probably because of one of two reasons:
1) The enumerator is nil, or
2) The enumerator is empty (ie. the folder is empty)
Add some debug log statements or step through the running code in the
debugger to find out what the problem is.
if(![[object substringToIndex:1] isEqualToString:@"."])
There are probably better (more robust) ways of identifying invisible
files. In any case, I would suggest you use "-hasPrefix:" to avoid
having to create a temporary string.
if([[[dir stringByAppendingPathComponent:object] pathExtension]
isEqualToString:@""])
You don't have to create a full path here, it is enough to get the "-
pathExtension" from "object".
[ftp deleteDirectory:object];
[ftp deleteFile:object];
You probably need the full path in these two cases though.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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