The code above changes the old name to new name of the directory when the directory is empty.
When the directory has another directory or file inside the directory, it produces the WARNING like the quote below.
Can I make it change the directory name with your help although the directory has some directories and files ?
Where can I give the Permission for changing the name of a directory?
(I want the directory change and not change any files or idrecotories inside the directory.