This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: getcwd() in cygwin 1.1.7 doesn't work properly in IIS web application


At 03:03 PM 1/10/2001, Daren Davis wrote:

>I have a CGI web application ported from Unix to the Windows NT / 2000
>platform using Cygwin.  Recently I upgraded my Cygwin tools from the B20
>release to 1.1.7.  After building my application with this new release, the
>getcwd() function call does not return a valid path.  For example, if the
>current directory in MS-DOS format is “D:\abc\def”, getcwd() returns
>“d/abc/def”.   After further investigation, I found that if I run the
>application in an MS-DOS command line window instead of my browser, getcwd()
>does return a complete and valid path in the form “/cygdrive/d/abc/def”.
>For some reason, the required “/cygdrive/” prefix is missing when the
>application is run under IIS on both the NT 4.0 server and a Windows 2000
>server.  Another weird situation is that if I have any Cygwin utility
>running concurrently on the server (e.g. bash, cat or wc waiting for input
>from stdin), then getcwd() does work properly when it is called under IIS.
>
>Has anyone else experienced these symptoms?  I searched on “getcwd” in the
>mail archives and could not find anything closely related.


Hm, this is a long shot but I noticed that your cygcheck output only had
/cygdrive defined for the current user.  Mine shows it for both the current
user and the local machine.  Since I expect that IIS runs as a user other 
than the current, this may well come into play.  I haven't checked the code
to see what is the hard-coded default path for unmounted drives but you might
want to try:

   mount -b -s --change-cygdrive-prefix /cygdrive

If this helps, it just indicates that the root of the path for unmounted 
drives is derived from the registry only (at least for the "local machine")
so this needs to be set.  Some poking around the code would probably give 
you the full answer if this doesn't resolve the issue.


Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
118 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]