in addition to all the answers that other friends have , if somebody who is looking this post is looking for a way to delete a "Folder" not a "file" , should take care that Folders must delete by php rmdir() function and if u want to delete a "Folder" by unlink()
, u will encounter with a wrong Warning message that says "permission denied"
however u can make folders & files by mkdir()
but the way u delete folders (rmdir()
) is different from the way you delete files(unlink()
)
eventually as a fact:
in many programming languages, any permission related error may not directly means an actual permission issue
for example, if you want to readSync
a file that doesn't exist with node fs module
you will encounter a wrong EPERM
error