Here's the script I used to figure out your question.

----------------------
opendir(DIR, "/");
@files = readdir(DIR);
print "@files\n";

chdir("e:/");

opendir(DIR, "/");
@files = readdir(DIR);
print "@files\n";
----------------------

When you run this you'll see that / refers root of the current drive letter.

As far as your other question, the net use account will use the currently 
logged on username and the password used to login when mapping drives.  If 
you login or start the script/program under a specific username & password, 
the 'net use' command will use that by default.  Just make sure the account 
has rights to connect to the share and everything should work.

Hope this helps,
Jeremy Blonde


>From: "Flynn, Timothy J" <[EMAIL PROTECTED]>
>To: "'Brian Gibson'" <[EMAIL PROTECTED]>,   "Perl-Win32-Users@listserv. 
>ActiveState. com (E-mail)"  <[EMAIL PROTECTED]>
>Subject: RE: A couple questions with windows and perl
>Date: Tue, 3 Apr 2001 11:01:21 -0500
>
>As stated in my email it is extremely important in this case to use this
>method /something/something.  I have used your method before but it won't
>work in this scenario.  My specific question was how to tell perl where /
>was and what drive it applied to, or to see if it was just the current 
>drive
>the perlscript was executing on at the time.  The net use information is
>beneficial although I don't like passwords being stored in text files.  I
>wonder if that is required since the program is already executing as the
>user who would authenticate.
>
>-Tim
>
>-----Original Message-----
>From: Brian Gibson [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 03, 2001 10:54 AM
>To: Flynn, Timothy J; Perl-Win32-Users@listserv. ActiveState. com
>(E-mail)
>Subject: Re: A couple questions with windows and perl
>
>
>this is what I use for paths in perl for win32
>
>c:\\folder\\folder\\filename.txt
>
>I backtick the "\" with another "\"
>
>Also, when you go to map a drive, I use the system function
>and the "net use" command (I know there is probably a module
>you can download in perl to do this.....)
>
>Here is an example
>
>system("net use x: \\\\pacer\\c   my_nt_password
>/user:MYDOMAIN\\briang");
>
>If you were to run this from DOS you wouldn't
>have to backtick everything like I did.
>This system call maps your x: drive to the share \\pacer\c  (the c drive
>share on the server pacer).
>
>Hope this helps, you can also run "net use /?"  to see the options for net
>use
>
>
>
>
>
>----- Original Message -----
>From: "Flynn, Timothy J" <[EMAIL PROTECTED]>
>To: "Perl-Win32-Users@listserv. ActiveState. com (E-mail)"
><[EMAIL PROTECTED]>
>Sent: Tuesday, April 03, 2001 11:00 AM
>Subject: A couple questions with windows and perl
>
>
> > Hi,
> >
> > First Question:  I have a program that relies on this type of UNIX
> > compatible path convention, i.e..  /somedir/someplace/somefile, instead 
>of
> > 'C:\somedir\someplace\somefile'.  This seems to work okay when I only 
>have
> > one drive, say drive c, but what changes say when I have a drive S: that 
>I
> > want to use as /?  I have tried chdir('s:\') but that doesn't seem to
> > totally do it.  Is there a way to set / to whatever drive root you want 
>it
> > to be and then have the script work normally from then on?
> >
> > Second Question:  When you run a perlscript on a windows system but
> > no one is logged in, say with the scheduler, do you have to create drive
> > mappings in the script or does windows use the drive mappings for the
> > account the script is running under?  If I need to create the mapping 
>can
> > you please provide a brief example of how this is accomplished?
> >
> > My config is windows 2000 server +
> > ActivePerl-5.6.0.623-MSWin32-x86-multi-thread.msi.
> >
> > TIA!
> > -Tim
> >
> > _______________________________________________
> > Perl-Win32-Users mailing list
> > [EMAIL PROTECTED]
> > http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
> >
>
>_______________________________________________
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>_______________________________________________
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to