You can use the -directory switch on the glob command to achieve the same thing.
Pete.
From: Jim Wilcoxson <[EMAIL PROTECTED]> Reply-To: AOLserver Discussion <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: [AOLSERVER] problems Date: Wed, 13 Nov 2002 09:20:49 -0800 The "cd" TCL command does not work in AOLServer, because all threads share the same working directory. When executed in multiple threads simulataneously, you have a race condition. We do this in _init.tcl, the first modules we load with AS: rename cd {} That disables the cd command altogether, which is what you want, because it doesn't work. Jim > > Hi. > > I've been experiencing a couple of problems with AOLServer. Running > apachebench with a concurrency of 2 or more would eventually cause > AOLServer to crash on this script: > > <% > cd /usr/local/aol32/servers/server1/pages/newspapers/cache/169/ > puts [glob -nocomplain "1_*.js"] > %> > > Strangely, when I shorten the directory that it is cd'ing to, it doesn't > crash. > > Also, when running this script under load, AOLServer crashes with the > following tcl error (which appears in generic/tclObj.c): > > <% > cd /usr/local/aol32/servers/server1/pages/newspapers/cache/169/ > puts [pwd] > %> > > UpdateStringProc should not be invoked for type cmdName > > I'm also getting the following error in production (can't reliably > reproduce it) (though I'm not sure that the two are related, as the > first stopped when I rewrote the relevant code to avoid use of glob > (though if 'cd' is the problem...)): > alloc: invalid block: 0x40100d94: 3c 40 0 > > Sometimes it will run for hours without crashing; other times it will > crash twice in a 5-minute period (all while under fairly significant > load). It's almost always the same memory address, if that provides any > additional insight. > > Thanks for any ideas you can provide. > > seth >
_________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail