• 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: Changing the case of a filename?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing the case of a filename?


  • Subject: Re: Changing the case of a filename?
  • From: "John C. Randolph" <email@hidden>
  • Date: Wed, 15 Aug 2001 20:37:31 -0700

On Monday, August 13, 2001, at 11:43 PM, Steve Gehrman wrote:

What is the proper way of changing the case of a file's name? The movePath routine does nothing!

BOOL result = [[NSFileManager defaultManager] movePath:@"/Users/joe/Hello.c" toPath:@"/Users/joe/hello.c" handler:nil];

I could do some lame hack like renaming the file to a temporary name and then back to hello.c, but that seems kind of stupid.
anyone have an idea? Is there a posix routine that may work?

The only way I've found that works is indeed changing the name to something altoghether different first. I ran into this in PB, when I'd accidentally named a file NSVIewExtensions.h, and wanted it to be NSViewExtensions.h. Since my project was on an HFS+ filesystem, PB was unable to rename it, and so was mv.

Let me also say, that a case-insensitive file system is a brain-dead idea, and that whoever was responsible for it back in the mid-80's should be tortured with a resource fork applied repeatedly to a sensitive part of his anatomy.

-jcr


For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken


References: 
 >Changing the case of a filename? (From: Steve Gehrman <email@hidden>)

  • Prev by Date: [Slightly OT] Lost Objectives, WAS:Re: Lost contents!
  • Next by Date: Re: Lost contents!
  • Previous by thread: Changing the case of a filename?
  • Next by thread: Re: Changing the case of a filename?
  • Index(es):
    • Date
    • Thread