• 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
fileExistsAtPath:isDirectory - BROKEN?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fileExistsAtPath:isDirectory - BROKEN?


  • Subject: fileExistsAtPath:isDirectory - BROKEN?
  • From: Bruce Truax <email@hidden>
  • Date: Wed, 02 Nov 2005 14:47:28 -0500
  • Thread-topic: fileExistsAtPath:isDirectory - BROKEN?

I am having trouble with fileExistsAtPath:isDirectory.  I have been using
this for some time and today, after upgrading to 10.4.3 it appears to be
broken.  The isDirectory flag does not appear to be set properly.  Here is
my code snippet:

    NSFileManager *fileManager = [NSFileManager defaultManager];
    aliasPath = [[NSString alloc] initWithFormat:@"~/Library/AccosLnks"];
    NSLog(@"isDir %i", isDir);
    [fileManager fileExistsAtPath:[aliasPath stringByExpandingTildeInPath]
isDirectory:&isDir];
    if (!([fileManager fileExistsAtPath:[aliasPath
stringByExpandingTildeInPath] isDirectory:&isDir] && isDir)){
        [fileManager createDirectoryAtPath:[aliasPath
stringByExpandingTildeInPath]
                                attributes:nil];
        NSLog(@"isDir %i", isDir);
        [aliasPath release];
    }

No matter whether the directory exists or not, isDir is always NO.  I even
tried to set isDir to another value prior to the test and it just retains
the original value.  Am I doing something wrong or is this a bug?

Bruce
--
____________________________________________________________
Bruce E. Truax                 email:  email@hidden
Optical Engineering Consultant

             Diffraction Limited Design LLC
388 Wedgewood Road             voice:  860-276-0450
Southington, CT  06489         fax:    860-620-9026
http://www.dld-llc.com
_____________________________________________________________


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: fileExistsAtPath:isDirectory - BROKEN?
      • From: Tom Harrington <email@hidden>
  • Prev by Date: Re: _NSKeyValueObservationInfoCreateByRemoving crashing
  • Next by Date: Creating folders for writing files to disk
  • Previous by thread: Dependent keys - non-cascading?
  • Next by thread: Re: fileExistsAtPath:isDirectory - BROKEN?
  • Index(es):
    • Date
    • Thread