Re: NSFileManager fileAttributesAtPath confusion
Re: NSFileManager fileAttributesAtPath confusion
- Subject: Re: NSFileManager fileAttributesAtPath confusion
- From: Chris Long <email@hidden>
- Date: Fri, 7 Mar 2003 09:03:49 -0700
On 金曜日, 3 7, 2003, at 12:36 AM, Lorenzo Puleo wrote:
>
> I tried such basic content in the filewithpathinfo as /usr/bin/tail
>
>
Please use this NSLog(@"-%@-", path);
I tried this out and it seems like there is a carriage return after the
path is displayed like this
-/usr/bin/tail
-
>
what doesn't work? You didn't specify.
Im sorry I am not sure how to explain but I think you get my problem.
>
>>> NSString *path = [NSString
>
>>> stringWithContentsOfFile:@"/tmp/filewithpathinfo"];
>
>>> NSDictionary *attributes = [[NSFileManager defaultManager]
>
>>> fileAttributesAtPath:path traverseLink:NO];
>
>>> NSLog(@"%@", path);
This appears to set attributes to null becasue its not reading my path
properly(?).
>
Does the file "path" exists?
Yes it does exist.
NSLog(@"-%@-", path) will give me
-/usr/bin/tail
-
So it looks like that may be my problem. Any way you can help me fix
that?
>
Is the parent folder of the file "path" readable?
>
Is the file "path" readable?
>
Can you read the file "path" with e.g. stringWithContentsOfFile?
Yes it is readable, yes the file is readable and if I use
NSDictionary *attributes = [[NSFileManager defaultManager]
fileAttributesAtPath:@"/One/Path/Im/Using" traverseLink:NO];
I get the correct information and it is reading that file.
Thanks in advance.
Chris Long
>
So your final Pathname should appear like -/usr/bin/tail-
>
and you can discover if there is some "space" before or after this
>
string.
>
>
--
>
Lorenzo Puleo
>
mailto:email@hidden
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.