APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Renaming files (answer)


2006/11/21

This is the answer to Detective: Renaming files

First, I did have a little hint here: I knew this customer had been thinking about buying a Mac. But the reason his files were being clobbered has to do with Mac's HFS+ file system: "Apple" and "apple" are NOT two different files. If he had begun his script with "set -o noclobber", Bash would have refused to overwrite, but as written, the "> $j" cleared out each file before the "sed" even ran.

Apple does have an optional HFSX file system which can be case sensitive. It isn't necessarily: Apple Tech Note TN1150 says:

An HFSX volume may be either case-sensitive or case-insensitive. Case sensitivity (or lack thereof) is global to the volume; the setting applies to all file and directory names on the volume. To determine whether an HFSX volume is case-sensitive, use the keyCompareType field of the B-tree header of the catalog file. A value of kHFSBinaryCompare means the volume is case-sensitive. A value of kHFSCaseFolding means the volume is case-insensitive.

Note: Do not assume that an HFSX volume is case-sensitive. Always use the keyCompareType to determine case-sensitivity or case-insensitivity.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Renaming files (answer)



Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





If we define Futurism as an exploration beyond accepted limits, then the nature of limiting systems becomes the first object of exploration. (Frank Herbert)





This post tagged: