Topic: File.delete()-Permission denied error in windows

All,

I am running a Ruby on Rails application in windows. I am getting "Permission denied error when delete a file". Also I am getting when move a file from one directory to another directory.

Please find the below code,

source_dir = "public/BuildingImages/Building1"
destination_dir = "public/BuildingImages/Building2"

Dir.mkdir(destination_dir) unless File.directory?(destination_dir)

FileUtils.mv(source_dir, destination_dir) # To move the file

# File.delete(source_dir) # To delete a file


Please let me know comments if you have any ideas?


Thanks,
Periyasamy

Last edited by Periyasamy (2012-06-15 03:21:03)