in reply to After listing the folder in a directoy, i unable to zip the folders by using system command.
Some comments:
- readdir (with double d) returns all contents of a directory, not only sub-directories.
- Your assignment to @folders suggests that you only want sub-directories?
- Apart from . and .. you should also exclude the directories starting with your $prefix. Otherwise, you backup them as well if you run the script twice. (Probably that is what you want?)
- Your zip command will not work with folder names containing blanks.