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.
Correct in a way. âPermission deniedâ simply means that the file itself cannot be moved because the file permission on that file doesnât let the server execute it (the function to rename the file). File permissions get a little hazy if you donât understand how it works.
Assuming this is on a Linux or Mac machine, itâs most likely set to 0644 by default. IIRC, to allow the server to execute the file, it should be set to 0755. I could be wrong.