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
I cant use force => true because it handles the error but still does not 
move the files.
>              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!

I found out that Im able to move files, like my excel files to my dest 
folder successully.. But I cant move a folder that contains the same 
excel file and it'll give the same error as the above (i.e Errno:EACCES. 
Could there be a possibility that there's a bug in the fileutils module?

-- 
Posted via http://www.ruby-forum.com/.