• 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
Re: More NSFileManager Issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More NSFileManager Issues


  • Subject: Re: More NSFileManager Issues
  • From: Andreas Grosam <email@hidden>
  • Date: Mon, 29 Oct 2012 11:11:28 +0100

On 29.10.2012, at 10:56, Andreas Grosam wrote:


The line
           if ([fm fileExistsAtPath:[_input1000 path] isDirectory:&isDirectory] || isDirectory) {

should read

           if ([fm fileExistsAtPath:[_input1000 path] isDirectory:&isDirectory] && !isDirectory) {


of course. But the issue still remains valid:

[fm removeItemAtURL:_input1000 error:&error]

returns NO, with error code 4, "The file “input1000.txt” doesn’t exist, even the file exists actually.



>            NSFileManager* fm = [[NSFileManager alloc] init];
>            NSLog(@"tmp file: %@", [_input1000 path]);
>            BOOL isDirectory;
>            if ([fm fileExistsAtPath:[_input1000 path] isDirectory:&isDirectory] || isDirectory) {
>                NSError* error;
>                if ([fm removeItemAtURL:_input1000 error:&error] == NO) {
>                    NSLog(@"ERROR: tear down testing environment with error: %@", error);
>                }
>            }
>


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >More NSFileManager Issues (From: Andreas Grosam <email@hidden>)

  • Prev by Date: ARC question
  • Next by Date: Re: More NSFileManager Issues
  • Previous by thread: More NSFileManager Issues
  • Next by thread: Re: More NSFileManager Issues
  • Index(es):
    • Date
    • Thread