From: Roger Pack Date: 2008-04-29T01:08:19+09:00 Subject: Re: Permission denied - (Errno::EACCES)- Help! double check the directory exists ? On Thu, Apr 24, 2008 at 10:23 PM, Clement Ow wrote: > Hi i remember posting this before but I needed to raise the issue again > because i dont think is due to my user acess rights. > My part of my code looks like this: > Dir.glob(src) do |file| > regexp = Regexp.new($exception) > puts match = regexp.match(File.basename(file)) > if match == nil > if $createDestDir == true > begin > Dir.chdir($destination) > Dir.mkdir(d) > FileUtils.move file, dst #:force => true > rescue Errno::EEXIST > FileUtils.move file, dst #:force => true > end #rescue > > and when running the script this error occurs: > > c:/ruby/lib/ruby/1.8/fileutils.rb:505:in `rename': Permission denied - > C:/MOVTEST/TESTING/NEW/ > 03-09/20080402 (Errno::EACCES) > > However when i tried moving files, it could execute the mv command > successfully. Therefore, I think it's not due to my user access rights > as I am an admin on my PC. On the other hand, I'm not using the files or > folders while i was running the script. Can anyone please help me with > this error? Thanks! > -- > Posted via http://www.ruby-forum.com/. > >