This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Mac OS and the fly likes POSIX and HFS paths Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "POSIX and HFS paths" Watch "POSIX and HFS paths" New topic

POSIX and HFS paths

Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Not really a Java question, but a Mac one. In fact, I will be implementing in C/C++ (ugh!).

Anyone know of a way to tell reliably whether a given path (as a string) is POSIX or HFS?

There are various "obvious" things to do, such as looking for colons and/or slashes. But those sorts of heuristics often have pitfalls. I am hoping there might be a properly thought-out approach.

I have looked in CFURL package of Mac frameworks, which has stuff for converting between POSIX and HFS, but not for determining which one you've got.

The higher-level requirement is that I want to take a file path that I have been given through an interface that doesn't say what type it is. It could be POSIX or HFS. I want to end up with a path that is definitely HFS.

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
I agree. Here's the link:
subject: POSIX and HFS paths
Similar Threads
Systems level difference between osx linux and unix
Porting pre-C++11 code
Enter in place of ctrl+c
Reading Unix Message Queue
Building a query for Tree