From: Simon Strandgaard Date: 2004-04-30T19:48:35+09:00 Subject: Re: File.expand_path(__FILE__) "Robert Klemme" wrote: > "Simon Strandgaard" schrieb im Newsbeitrag > > > > Maybe extend __FILE__ with a #absolute method, > > in order to make __FILE__ immune against chdir ? > > This is easily fixed: > > FILE = File.expand_path __FILE__ > p [__FILE__, FILE] Not if the person has done a chdir just before expand_path. I wonder why __FILE__ isn't an absolute path. Relative paths is just too fragile. Proposal: make __FILE__ an absolute path. That would make __FILE__ robust to Dir.chdir. Any thoughts on this proposal? fore or against -- Simon