[Tutor] where am I revisited

kirk Bailey idiot1@netzero.net
Thu, 28 Feb 2002 23:58:38 -0500


OK, it is working now, and here is how.


-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-begin code
snippet-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
#120                         CONFIGURATION SECTION
#                            #####################
#                       
# NOTE that this script is SUPPOSED to be installed in the web
cgi-bin!
# and the lists dir is immediately under this dir!
#                       
# ok, where am I? I just woke up!
fullpathtoscript = os.path.split(os.path.abspath(sys.argv[0]))   
print 'fullpathtoscript=',fullpathtoscript
# ok, now my config file is supposed to be RIGHT HERE with me!
#130 So let's read the thing!
f1=open(fullpathtoscript[0]+"/tinylist.cf",'r')
# Tell me little file, who am I?
localhost=string.strip(f1.readline())
f1.close()
# knowing where I am, I know that my lists are ONE FLOOR DOWN!
path=fullpathtoscript[0]         
print 'Path=',path
# ALL TinyList scripts MUST live in the web cgi-bin, and
# ALL global and list files are directly off the web cgi-bin dir in
'/lists'.
#140 that dir should be owned by the same owner and group as this
script, and
# should be chmod 766. DIR 'list' must be 766, with all Scripts 755.
# 
-=-=-=-=-=-=-=-=-=-end code
nippet=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
All it has to read is it's domain name from the tinylist.cf file. As
soon as I jam this into all the other scripts, I will wrap it up and
issue a new generation of the program.

Now, the only thing the user must insure is correct is line 1, the one
pointing to the interpeter. I read someone posting some code that
makes the server ggo FIND the interpeter, which would avoid this, but
this takes much more time to execute the script, and if you host
several busy lists, would be a serious overhead price for sake of not
doing 5 minutes of work.

Thanks for the clues folks, it helps to have people like you in the
community.












-- 
 
end
	    Respectfully,
			 Kirk D Bailey


+---------------------"Thou Art Free." -Eris----------------------+
| http://www.howlermonkey.net mailto:highprimate@howlermonkey.net |
| http://www.tinylist.org  +--------+  mailto:grumpy@tinylist.org |
+------------------Thinking| NORMAL |Thinking---------------------+
                           +--------+

NOTE: By sending SPAM to this address you agree to pay me a service
fee of $100 for the service of receiving,  storing,  examining, and
deleting your piece of SPAM. I am a postmaster, and take a dim view
of such.
----------------------------------------------------
Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97