ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: Translating UNC paths to local paths
Date Tue, 21 May 2002 18:41:06 GMT
Without some really low-level NT hacking its unlikely you'll find an easy
way to do this.  You'd likely need administrator privileges on the remote
machine to be able to query its share mappings.  The UNC is mapping to a
remote "share", and only the remote machine knows the actual drive and
directory that is corresponding to (unless you were going through the
default administrative c$-like shares, in which case its easy to see the
remote path).

I would re-evaluate whatever it is you're trying to do and come up with some
other ways. Could you elaborate on exactly what you're trying to accomplish?

    Erik

----- Original Message -----
From: "Hal Hildebrand (web)" <Hal.Hildebrand@hellblazer.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Tuesday, May 21, 2002 2:30 PM
Subject: Translating UNC paths to local paths


> Probably no one knows how to do this, but I thought I'd give it a whirl.
>
> I need to translate Windows UNC paths to their canonical path on the
> remote machine.
>
> For example:
>
>     \\ss04\root\some\mapped\dir
>
> Would map to the directory (on host ss04):
>
>     D:\some\dir
>
> I have searched high and wide for a way to do this with no avail.  The
> logical thing, from Java is to maybe run the Java process in this
> directory, then do something like:
>
>     new File(".").getCanonicalPath()
>
> Which returns
>
>     \\ss04\root\some\mapped\dir
>
> Anyone out there have a clue as to how to do this?
>
> Thanks.
>
> -Hal
> ______
> science does not remove the terror of the gods
> www.hellblazer.com
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message