Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return value of opendir when running in Netscape vs.IE

Status
Not open for further replies.

egank

Programmer
Sep 12, 2002
4
US
I'm running a perl script from a web page. My script does an "opendir" to check for the existence of a directory:

$dir1 = "\\servername\directory";
if (opendir(DIR,"$dir1") != 1)
{
&errCanNotOpenDir;
}

When running the script through a Netscape browser, the call to opendir returns one (1) for a directory that I've verified exists. If I run in IE, with the same directory, the opendir command returns no value.

Anyone know why I might be getting different results?
 
This probably has more to do with how your errCanNotOpenDir sub displays the value rather than what the actual return value is. The action of opendir() is NOT browser dependant, I guarantee it.

jaa
 
I agree 100%. The print statements the following code may render differently in the two browsers:

$dir1 = "\\servername\directory";
$xyz = opendir(DIR,"$dir1");
if ($xyz != 1)
{
&errCanNotOpenUploadDir;
}

sub errCanNotOpenUploadDir
{
print "content-type: text/html\n\n";
print &quot;<html><body>&quot;;
print &quot;<b>$xyz</b>&quot;;
print &quot;</body></html>&quot;;
exit;
}

The problem is that for an existing server\directory, IE fails the test and runs the error subroutine and Netscape does not. In particular, IE fails when $dir1 is in the UNC format (\\servername\directory) but passes when $dir1 is the physical path (F:\directory). Netscape works correctly for both formats.

Any idea why IE is failing with the UNC format?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top