Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl - Parse UNC Path in a string variable

Reply
Thread Tools

Perl - Parse UNC Path in a string variable

 
 
Kevin Joseph
Guest
Posts: n/a
 
      08-12-2004
I have written a Perl script to modify some files over the network.
All PCs are Win2k. Most of the files reside on a share in the form of
\\server\share_name. Some of the files are on dirves in the form of
\\server\d$ and this is where my problem is.

My script prompts the user for the file name. It store the information
in a variable, parses it and then accesses it. If the file name
entered is \\server\share_name\filename, I do not have a problem. With
\\server\d$\filename however it simply fails. I have the logic to
convert \ to \\ which is why the former works
(\\server\share_name\filename). I tried escaping the $ (using \$) but
that did not work. I have tried various permutations and combinations
thus far and as a last option am sending my request to this newsgroup.

Kindly help.

Kevin.
 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      08-12-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Kevin Joseph) wrote in
news:(E-Mail Removed) om:

> I have written a Perl script to modify some files over the network.
> All PCs are Win2k. Most of the files reside on a share in the form of
> \\server\share_name. Some of the files are on dirves in the form of
> \\server\d$ and this is where my problem is.
>
> My script prompts the user for the file name. It store the information
> in a variable, parses it and then accesses it. If the file name
> entered is \\server\share_name\filename, I do not have a problem. With
> \\server\d$\filename however it simply fails. I have the logic to
> convert \ to \\ which is why the former works
> (\\server\share_name\filename). I tried escaping the $ (using \$) but
> that did not work. I have tried various permutations and combinations
> thus far and as a last option am sending my request to this newsgroup.
>
> Kindly help.


Kindly provide some useful information then. You indicate that you
'parse' the variable, that you have the 'logic' to convert \ to \\ etc
but never show code. We are not mind readers here. Please read

http://www.catb.org/~esr/faqs/smart-questions.html

to learn how to formulate your question so others can understand and help
you. Smart questions get answers. 'Does not work' doesn't.

--
A. Sinan Unur
(E-Mail Removed)lid
(remove '.invalid' and reverse each component for email address)

 
Reply With Quote
 
 
 
 
Kevin Joseph
Guest
Posts: n/a
 
      08-12-2004
Is this a Perl newsgroup or a newsgroup for someone from KinderGarden
or it is that you are trying to market some web page for dummies ? I
think I will just ignore your comment and wait for others to answer.

Kevin.
 
Reply With Quote
 
Matt Garrish
Guest
Posts: n/a
 
      08-13-2004

"Kevin Joseph" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
>
> My script prompts the user for the file name. It store the information
> in a variable, parses it and then accesses it. If the file name
> entered is \\server\share_name\filename, I do not have a problem. With
> \\server\d$\filename however it simply fails. I have the logic to
> convert \ to \\ which is why the former works
> (\\server\share_name\filename). I tried escaping the $ (using \$) but
> that did not work. I have tried various permutations and combinations
> thus far and as a last option am sending my request to this newsgroup.
>


Since you don't even post what the actual failure message is, let alone
working code that demonstrates the problem, you shouldn't be surprised
you're not getting any help.

Matt


 
Reply With Quote
 
Anno Siegel
Guest
Posts: n/a
 
      08-13-2004
Kevin Joseph <(E-Mail Removed)> wrote in comp.lang.perl.misc:
> Is this a Perl newsgroup or a newsgroup for someone from KinderGarden
> or it is that you are trying to market some web page for dummies ? I
> think I will just ignore your comment and wait for others to answer.


Good luck then.

Anno
 
Reply With Quote
 
Joe Smith
Guest
Posts: n/a
 
      08-13-2004
Kevin Joseph wrote:

> Is this a Perl newsgroup or a newsgroup for someone from KinderGarden
> or it is that you are trying to market some web page for dummies ?


It was a serious request for more information in order to help you
solve your problem.

>>> I have the logic to convert \ to \\ which is why the former works
>>> (\\server\share_name\filename).


Could you show us your logic? It might need a bit of a rework.

>>> I tried escaping the $ (using \$) but
>>> that did not work. I have tried various permutations and combinations
>>> thus far and as a last option am sending my request to this newsgroup.


Could you show us which permutations and combinations you've tried so far?

> Kindly provide some useful information then. You indicate that you
> 'parse' the variable, that you have the 'logic' to convert \ to \\ etc
> but never show code. We are not mind readers here.


In other words, show us the actual code you've tried so far.
-Joe
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
extract UNC path using regular expression ksr ASP .Net 5 02-15-2011 10:41 AM
How to parse a string like C program parse the command line string? linzhenhua1205@163.com C Programming 19 03-15-2005 07:41 PM
Perl - Parse UNC Path in a string variable Kevin Joseph Perl Misc 8 08-13-2004 11:56 AM
Retrieving UNC Path of Mapped Drives on Client Machine =?Utf-8?B?RGVhbiBNY0NhcnRlbg==?= ASP .Net 7 05-20-2004 02:41 PM
AppDomain.CurrentDomain.BaseDirectory in ASP.Net for UNC path. George Nevsky ASP .Net 1 05-16-2004 04:47 AM



Advertisments