Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
perl script executing in diffrent directories
herald10
Hi,
I have written a perl script that runs on each submit event. The script opens an XML file and does the processing. At the same time writing to a log file. It usually generates the log file under iwhome/local/logs.The problem is some times it generates the log file in a different directory /x/y/z/logs. The log file name I gave in the script was logs/submitXX.log. Also it reports XML parser error while reading that XML file. Any insights? I think its an OS thing which I am not aware of.
Thanks
-H
Find more posts tagged with
Comments
Adam Stoller
My guess is that you aren't guaranteed a "current working directory" when the event is triggered - and thus - you should be specifying an *absolute* path in your script
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Dwayne
TeamSite::Config::iwgethome() is your friend. Use it liberally, and you won't have these problems.
herald10
Thanks for the reply. The script was functioning properly for 5 months without any complaints. One of my colleagues was logged in another directory as root. He was modifying some scripts there. Thats when this script started throwing errors. Now it all makes sense. I have changed the paths and its working great as ever.
Thanks again
-H