Thank you! I have used realpath, and it worked as like a charm!
Here's my code. One question only: is the NSUTF8StringEncoding correct?

- (NSString*)CaseSensitiveFilePath:(NSString*)filePath
{    
    const char    *cFilePath = [mManager
                            fileSystemRepresentationWithPath:filePath];
    if(cFilePath == 0 || *cFilePath == L'\0') return filePath;
    
    int            len = PATH_MAX + 1;
    char        cRealPath[len];
    memset(cRealPath, 0, len);
    char        *result = realpath(cFilePath, cRealPath);
    
    //printf("CaseSensitiveFileName %s\n", result);
    if(result != NULL) return [NSString stringWithCString:result
                                        encoding:NSUTF8StringEncoding];
    else return filePath;
}


Thank you again
--
Leonardo




>> 
>> On Mar 17, 2010, at 6:35 AM, gMail.com wrote:
>> 
>>> Now I need to get its real case sensitive file name, which is indeed e.g.
>>>  "FileName.txt"
>>> How can I get it in a fast way? I thought by its inode, but I can't really
>>> know how to do that.
>> 
>> Have you tried -[NSString stringByStandardizingPath], or the BSD function
>> realpath()? The docs don¹t explicitly say they correct case, but it seems
>> like the kind of thing they would do.
>> 
>> ‹Jens_______________________________________________
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/aaron.burghardt%2Bcocoa-dev%
>> 40gmail.com
>> 
>> This email sent to aaron.burghardt+cocoa-...@gmail.com
> 


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to