SPUG:-e filecheck on windows web app

David Innes davidinnes at chicagoscience.com
Thu May 22 12:23:38 CDT 2003


I've run into stuff like this a couple of times.  For me it's usually a
permissions context problem.  Check to make sure the IIS process account
(probably named something like IUSR_Machine2) on //Machine2 has the same
file access permissions as the one on //Machine1.

Chances are it'll work for you from the command line because (at least on
machines where IIS has been properly locked down) user accounts have broader
file permissions that IIS process accounts.  And chances are it'll work via
CGI after the IIS process has access permission.

If that's the problem then it's not isolated to Windows systems -- the same
behavior manifests in Unix/Linux too.  It's mentioned couple of times in the
O'Reilly CGI Programming book.

		-- David Innes

-----Original Message-----
From: spug-list-admin at mail.pm.org [mailto:spug-list-admin at mail.pm.org] On
Behalf Of John Subaykan
Sent: Wednesday, May 21, 2003 4:05 PM
To: spug-list at pm.org
Subject: SPUG:-e filecheck on windows web app

I have copies of the same CGI script on two machines on my network.  This 
script, somewhere along the line, checks the existence of a file or 
directory on a third machine on the same network:

if (-e "//Machine3/path/to/file)

when this script is runs on //Machine1, (as it has been running until now) 
the file is found, and the test evaluates to true.

on //Machine2 (where this CGI will now reside), this test finds no such 
file.

the pathname is hard-coded as a UNC path, but other tests in the same script

(or one of its modules) test filenames stored in variables:

if (-e $myFile)

these all fail on //Machine2

But when I run a simple command line test on //Machine2 like this:

if (-e "//Machine3/bla/bla) {
  print "it exists";
} else {
  print "no it doesn't";
}


... from the command line, this script tells me that the file exists.  A web

app running on the same machine tells me otherwise.

Has anyone run into this problem before?  (both //Machine1 and //Machine2 
are Windows 2000 running IIS 5)

Thanks,

John

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

_____________________________________________________________
Seattle Perl Users Group Mailing List  
POST TO: spug-list at mail.pm.org
ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list
MEETINGS: 3rd Tuesdays, U-District, Seattle WA
WEB PAGE: www.seattleperl.org





More information about the spug-list mailing list