Home: Perl Programming Help: Win32 Programming Help:
Writing to shared network drive

rizvi
Deleted

Jun 12, 2000, 3:43 AM

Views: 11277
 Writing to shared network drive
Am running ActivePerl on an IIS Server (NT).
Trying to write a CGI script
open("REQFILE", "> outputfile") - works file;
creates file in script directory.

I want to create a file on a network machine.
I mapped this share to the server as J: drive
and tried open("REQFILE", "> J:\\outputfile") - but does not like this.

How can I reference a share on a network drive in open();

Thanks

TheGame+
Deleted

Jun 14, 2000, 6:39 AM

Views: 11277
 Re: Writing to shared network drive
Just a thought : does the webserver know that "J:" corresponds to "\\\\some_server\\some_share" ? It's running under a different user, after all...

dws
Deleted

Jun 14, 2000, 6:40 PM

Views: 11277
 Re: Writing to shared network drive
If you check \$! after the open fails, it'll say "Bad file descriptor", which is NTs somewhat cryptic way of telling you that IIS can't see J:

As mentioned above, IIS is running as a different user. How to get IIS to see J: is a separate question, for which I have no answer.

rizvi
Deleted

Jun 15, 2000, 1:26 AM

Views: 11277
 Re: Writing to shared network drive
On the Webserver machine (NT4) I have mapped
J: to the share using
net use j: \\essbase3\MinervaQuery
On the Webserver clicking on J: drive on
NT Explorer shows all files in share MinervaQuery. Also I can read/write to it
from Webserver. If I run the code natively on Webserver it works. Problem seems to be when it runs as CGI.

dws
Deleted

Jun 18, 2000, 10:44 PM

Views: 11277
 Re: Writing to shared network drive
Shared drives are typically reconnected at Login. Have you done something special (such as having the web server process log in as you) to allow the web server to see them?