From: lasitha Date: 2009-05-12T03:10:43+09:00 Subject: Re: File.basename bug? On Mon, May 11, 2009 at 9:14 PM, Reid Thompson wrote: > How often do people get bitten by this? > When operating on a file in the current directory, './' must be > prepended to a filename for File.basename to work... Hi, i'm either not understanding your issue or not seeing it on my box: $: cd /tmp; touch by.touch $: ruby19 -ve "puts File.basename 'by.touch'" ruby 1.9.1p0 (2009-01-30) [i386-darwin8.11.1] by.touch $: ruby -ve "puts File.basename 'by.touch'" ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin8] by.touch > $ cat bug.rb > DATAFORMAT_VERSION=1 > > def processInputFile(inputFpath) >    puts "inputFpath #{inputFpath}" >    dirpath = File.dirname(inputFpath) > >    outputfile = File.basename(inputFpath) >    outputfile.gsub!("pp_",'') >    outputfile = dirpath + '/' + 'SDF_' + "#{DATAFORMAT_VERSION}" + '_' + outputfile >    puts "outputfile #{outputfile}" >    puts "inputFpath #{inputFpath}" > > end > > processInputFile("pp_a_test_file_name") > rthompso@raker>/home/rthompso > $ ruby bug.rb > inputFpath pp_a_test_file_name > outputfile ./SDF_1_a_test_file_name > inputFpath a_test_file_name > rthompso@raker>/home/rthompso > $ ruby -v > ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-linux] > > rthompso@raker>/home/rthompso > $ vi bug.rb > rthompso@raker>/home/rthompso > $ ruby bug.rb > inputFpath /home/rthompso/pp_a_test_file_name > outputfile /home/rthompso/SDF_1_a_test_file_name > inputFpath /home/rthompso/pp_a_test_file_name Scanned over the above but couldn't spot what you might be on about :) Perhaps you could clarify or wittle the example down a bit further? cheers, lasitha