Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using CGI exe with IW
So, a little RFC just for fun:

The Common Gateway Interface (CGI) Version 1.1:

There we read:

Quote:7.2.  UNIX

  The current working directory
      The current working directory for the script SHOULD be set to the
      directory containing the script.

Remember that there is no CGI spec for Windows. So I'm using UNIX as the base. Others are just the same.

So, we need to find out what SHOULD means in that RFC. If we go back a little, in the same RFC we read:

Quote:1.2.  Requirements

  The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT',
  document are to be interpreted as described in BCP 14, RFC 2119 [3].

This is basically the same for all RFCs. Then we go to BCP 14 to find out what SHOULD means:

From there I quote:

Quote:1. MUST  This word, or the terms "REQUIRED" or "SHALL", mean that the
  definition is an absolute requirement of the specification.


3. SHOULD  This word, or the adjective "RECOMMENDED", mean that there
  may exist valid reasons in particular circumstances to ignore a
  particular item, but the full implications must be understood and
  carefully weighed before choosing a different course.

As you can see, SHOULD means RECOMMENDED. It is not an obligation to fulfill the requirements. I've also included item 1 (MUST) to show that the spec would definitely use MUST, and not SHOULD, if that was a requirement of the spec. MUST is only used when it is a requirement. 

On the other hand, knowing that there is no obligation to set the current directory when calling a CGI script, the CGI script developer MUST make sure that the current directory is set if the task performed by the script is sensitive to current directory setting. Whoever does it differently is lazy.    Rolleyes
Hi, Alexandre
Thank you for your patience to search all these informations.
As you said, it´s "recommended'.
But if the CGI author doesn´t follow it, we are unable to use IW CGI Runner in our case being discussed.

But, WAMP web server take it in consideration and set the working dir. And others web servers such ISS as well.
Otherwise, the CGI from conquest dicom software would have problems running in WAMP and ISS. But, It works well in WAMP and IIS.

So, is possible you add an option to set working dir?

The change is already done. It will be available in the next release in the following days.
FWIW, you have full source to the CGI runner. Small feature changes like this you can very easily apply on your own as well.

Forum Jump:

Users browsing this thread: 1 Guest(s)