When I try to delete a file I am getting acess denied as error .How should I set the mode of a file or is there any way of deleting a file forcefully with out ch开发者_运维知识库anging the mode.
This question is OS-dependent.
With UNIX/Linux it is neccessary to have write permission for the directory containing the file. If the sticky bit is set on the directory (like on /tmp) you have to be owner of the file, too.
If you're using annother OS you may want to refine your question.
You need to change the permissions of the file and its parent folders. As far as I know there is no way to delete a file forefully without having necessary permissions. Adjusting permissions of a file will differ for different operating systems.
for *nix see: chmod
精彩评论