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.
Mmmm, not prety sure, but when you are moving a file or dir with
FileUtils, you are deleting it too from the previous location, so the
work is done simply calling the mv() FileUtils method, you don’t have to
‘delete’ it…
Mmmm, not prety sure, but when you are moving a file or dir with
FileUtils, you are deleting it too from the previous location, so the
work is done simply calling the mv() FileUtils method, you don’t have to
‘delete’ it…
Damian,
Thanks for your reply. You are right!. First I tired to move the file
from one directory to another directory. Then, I got the permission
denied error and the file can’t be moved. So, I tried in another
solution instead of mv() (moving file), I just tried to copy the file to
the destination directory. Here, the file is copied to the destination
directory. But I am unable to delete the source file when I use
“File.delete(file)”. Because I am getting the same “Permission denied
error”.
I don’t have many time so research(working…). My suggestion is: look
at File.chmod() or File#chmod() methods. Perhaps some of your files
inside the source directory is being used by the app, or Windows. Here
you have another suggestion…
I don’t have many time so research(working…). My suggestion is: look
at File.chmod() or File#chmod() methods. Perhaps some of your files
inside the source directory is being used by the app, or Windows. Here
you have another suggestion…