943,867 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Marked Solved
  • Views: 4180
  • Perl RSS
Apr 10th, 2009
0

How to check whether network drive is mapped or not

Expand Post »
Hi,

Can somebody let me know how to check whether particular network drive is mapped or not e.g x:\\share1\share2?

Regards,
Rana
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rana03 is offline Offline
9 posts
since Mar 2009
Apr 11th, 2009
0

Re: How to check whether network drive is mapped or not

Are you asking how to check that it's mounted from the system that's accessing it? This is pretty simple and just a matter of trying to access the drive. If you're looking for a simple command line to do it I suppose just running CD X (X being the letter assigned to the newtork drive) would do the job, since you should get an error if the drive isn't accessible.
Reputation Points: 124
Solved Threads: 36
Practically a Master Poster
OlyComputers is offline Offline
604 posts
since Jun 2008
Apr 20th, 2009
0

Re: How to check whether network drive is mapped or not

or try
perl Syntax (Toggle Plain Text)
  1. $dir = "x:\\share1\\share2";
  2.  
  3. if (-d $dir);
  4. {
  5. print $dir," exists\n";
  6. }
  7. else
  8. {
  9. print $dir," not found\n";
  10. }

.
Last edited by jephthah; Apr 20th, 2009 at 3:08 pm.
Reputation Points: 2143
Solved Threads: 178
Posting Maven
jephthah is offline Offline
2,567 posts
since Feb 2008
Apr 20th, 2009
0

Re: How to check whether network drive is mapped or not

Wow, I completely forgot to check which forum this was in. Thanks for a good Perl answer Jephthah.
Reputation Points: 124
Solved Threads: 36
Practically a Master Poster
OlyComputers is offline Offline
604 posts
since Jun 2008
Apr 28th, 2009
0

Re: How to check whether network drive is mapped or not

yeppp thanks jephthah this really helped me a lott
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rana03 is offline Offline
9 posts
since Mar 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: New to Perl HELP.
Next Thread in Perl Forum Timeline: How to convert text file to binary file and Binary to text using perl





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC