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

More NSFileManager Issues


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

I do have even more weird issues with NSFileManager:


With NSFileManager I've created a file in the temporary directory. Attempting to delete it, fails:

            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);
                }
            }

Console:

tmp file: /var/folders/m9/5p__qm3967qchc9_26tl85km0000gn/T/RelaxTest/input1000.txt

ERROR: tear down testing environment with error: Error Domain=NSCocoaErrorDomain Code=4 "The file “input1000.txt” doesn’t exist." UserInfo=0x10011e700 {NSURL=/var/folders/m9/5p__qm3967qchc9_26tl85km0000gn/T/RelaxTest/input1000.txt}


The file exists actually, and there are no issues regarding permissions.


Terminal:

~$ cd /var/folders/m9/5p__qm3967qchc9_26tl85km0000gn/T/RelaxTest
mb:RelaxTest$ ls -al
total 8
drwxr-xr-x  3 me  staff   102 29 Okt 10:05 .
drwx------  9 me  staff   306 29 Okt 10:44 ..
-rw-r--r--  1 me  staff  1000 29 Okt 10:44 input1000.txt
mb:RelaxTest$ more input1000.txt
0123456789012345678901234567890123...6789
mb:RelaxTest$




Any hints?

Thanks in advance!

Andreas



_______________________________________________

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


  • Follow-Ups:
    • Re: More NSFileManager Issues
      • From: Mike Abdullah <email@hidden>
    • Re: More NSFileManager Issues
      • From: Vincent Habchi <email@hidden>
    • Re: More NSFileManager Issues
      • From: Andreas Grosam <email@hidden>
  • Prev by Date: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists
  • Next by Date: ARC question
  • Previous by thread: Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists
  • Next by thread: Re: More NSFileManager Issues
  • Index(es):
    • Date
    • Thread