Steel Steel wrote:
> Amit Tomar wrote:
>> dir ="C:/DOCUME~1/x0100039/LOCALS~1/Temp"
> 
> Try using the full path (without ~)

Thanks steel i tried with full name but still getting problem

require 'fileutils'

dir ="C:/Documents and Settings/x0100039/Local Settings/Temp"
Dir.chdir(dir)
Dir.glob('*').each do|f|

  FileUtils.rm(f)


 end
but am getting these error:
C:/InstantRails-2.0-win/ruby/lib/ruby/1.8/fileutils.rb:1297:in `unlink': 
Permission denied - CGI.3408.1 (Errno::EACCES)
  from C:/InstantRails-2.0-win/ruby/lib/ruby/1.8/fileutils.rb:1297:in 
`remove_file'
  from C:/InstantRails-2.0-win/ruby/lib/ruby/1.8/fileutils.rb:1305:in 
`platform_support'
  from C:/InstantRails-2.0-win/ruby/lib/ruby/1.8/fileutils.rb:1296:in 
`remove_file'
  from C:/InstantRails-2.0-win/ruby/lib/ruby/1.8/fileutils.rb:771:in 
`remove_file'
  from C:/InstantRails-2.0-win/ruby/lib/ruby/1.8/fileutils.rb:549:in 
`rm'
  from C:/InstantRails-2.0-win/ruby/lib/ruby/1.8/fileutils.rb:548:in 
`each'
  from C:/InstantRails-2.0-win/ruby/lib/ruby/1.8/fileutils.rb:548:in 
`rm'
  from ruby2.rb:8
  from ruby2.rb:5:in `each'
  from ruby2.rb:5
-- 
Posted via http://www.ruby-forum.com/.