• 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: Case sensitive fileName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Case sensitive fileName


  • Subject: Re: Case sensitive fileName
  • From: Aaron Burghardt <email@hidden>
  • Date: Wed, 17 Mar 2010 13:22:31 -0400

Jens gets the prize:

$ cat realpath_test.c

#include <stdio.h>
#include <sys/param.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

	char resolved_name[PATH_MAX];

	realpath(argv[1], resolved_name);

	printf("%s\n", resolved_name);
}

$ gcc realpath_test.c -o realpath_test

$ ./realpath_test REALPATH_TEST.C
/private/tmp/realpath_test/realpath_test.c

-[NSString stringByStandardizingPath] did not work in one test.

Aaron

P.S. Be sure to pass -[NSString fileSystemRepresentation] to realpath().


On Mar 17, 2010, at 12:07 PM, Jens Alfke wrote:

>
> 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 (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

_______________________________________________

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: Case sensitive fileName
      • From: "gMail.com" <email@hidden>
References: 
 >Case sensitive fileName (From: "gMail.com" <email@hidden>)
 >Re: Case sensitive fileName (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Directory to save file in NSSavePanel
  • Next by Date: Re: Case sensitive fileName
  • Previous by thread: Re: Case sensitive fileName
  • Next by thread: Re: Case sensitive fileName
  • Index(es):
    • Date
    • Thread