Re: Changing the case of a filename?
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