[BangPypers] in CGI using getcwd

Vivek Rajendran vivekbest86 at yahoo.com
Tue Nov 24 05:31:46 CET 2009


Hi,
    I'm facing a problem as follows in using os.getcwd() in CGI scripting
(Linux FC2 ,FC11)
For Ex:
      I'm having my web folder and index.py file in location
/var/www/html/foobar/index.py.
      Also, I have a test file info.txt in the same foobar folder.
      My index.py is not able to open the file and read it in tha folder.
Instead it reads under '/' folder.
      When I did os.getcwd() surprisingly I'm getting '/' as the current
folder irrespective of location wherever I run the script. Also, I tried
os.environ['PWD']. Same is the problem.(In windows both the approaches are
working properly)
      Is this a configuration issue? If then, please tell me which file I
need to configure (like httpd.conf,python.conf) and how to do it?
      It will be of great help to me If anyone provides me a clear and
working soluton.

Thanks and Regards
Vivek Rajendran
      
-- 
View this message in context: http://old.nabble.com/in-CGI-using-getcwd-tp26490352p26490352.html
Sent from the BangPypers - Bangalore Python Users Group mailing list archive at Nabble.com.



More information about the BangPypers mailing list