ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hal Hildebrand \(web\)" <Hal.Hildebr...@hellblazer.com>
Subject Re: Translating UNC paths to local paths
Date Tue, 21 May 2002 18:54:31 GMT
I'm not afraid of low-level NT hacking, so if that's necessary...

What I'm trying to do is remote deployment and administration of NT
services - which happen to be implemented in Java - in Ant.

Administrator privileges are not an issue, as they are required by the
person doing these functions - it's assumed.

I thought about using the default administrative shares, but I'm not
sure I can count on them - if I have to, well that's life and I'll
accept that as a constraint.

The procedure I have is to ask the administrator for a remote deployment
directory.  This is in UNC format.  I then copy the deployment files
over there, but then I need to execute remotely (to install the NT
service, and other tasks).  This is no problem using psexec, but the
problem is psexec requires (for the obvious reason) the file name in an
absolute form on the remote system.

Wait a minute.  I just tried psexec with a UNC file name, which would be
the same on both the remote and local computers and it worked.  So I
think that's the ticket - just deal with UNC paths.  Thank "Bob".

Very strange, though.  This would seem to be something extremely useful
and I'm surprised (although not really) that it doesn't already exist in
some form...

----- Original Message -----
From: "Erik Hatcher" <jakarta-ant@ehatchersolutions.com>


> 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>
>
>
>


--
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