Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding all mounted volumes



Jason Boyd <email@hidden> first wrote:

>[...] Our legacy data contains file paths
>which include the volume name and use old Mac syntax like so:
>
>Foobar CD:Some Directory:subdir:file.ext
>
>Now I need to manipulate these paths to find the actual file but it must
>work on OS X, Windows 98 and later, and Linux/UNIX.

The more I think about it, the more I think this is the problem to solve.
In short, how do you transform Strings in an arbitrary, even archaic, form
into live pathnames acceptable to File on the current host? That's a
different question than finding all mounted volumes.

That is, think of the problem not as "translating paths", but as
transforming an archaic name-String (albeit in a particular form) into a
live File-usable pathname on the current host platform. Then the problem
is not so much enumerating volumes as knowing where the program should
start looking for the actual files and directories referred to. There's
also how the program should look for potential matches, i.e. the
questing/resolving process itself, not just the starting point. Both the
starting point and the resolving process may differ across platforms,
mainly because what constitutes a File-usable pathname differs across
platforms.

First, I assume those archaic strings don't exist in isolation. Where do
these strings reside? Can you do a wholesale up-front conversion, or do
you have to transform the archaic form to a live File-usable form every
time?

Second, I assume the archaic strings actually refer to something, and it's
the "somethings" that you're interested in. Where do the "somethings"
reside? Can the strings be turned into File's (or File-acceptable
pathnames) without actually referring to the file-system? Are you looking
for a purely syntactic (textual) transformation, or do you want to then do
something with a File? How dynamic is the environment in which the archaic
strings are translated into File-compatible pathnames? For example, if the
"somethings" on "Foobar CD" aren't available (can't be resolved into an
existing file), what do you want to happen? How many CD's do you want to
be able to resolve at once?

It might help to know exactly what you're trying to do. That is, explain
where the archaic strings come from, what they refer to, where the
referents come from, and what the lifetime and portability is of the
converted File-compatible form.

-- GG
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.