in reply to Create zip files for each sub-directory under a main directory
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Create zip files for each sub-directory under a main directory
by mrd1019 (Novice) on Nov 30, 2016 at 16:35 UTC | |
Thanks for all the help guys! I'm new to perl, been trying to teach myself via websites like this and books. Nothing compares to having experienced users help out though! I've updated the code, based on a lot of the advice I've been given. The code now creates the zip files correctly (correct name with all the files inside). There are still a couple of things I'd like to change though. First, it creates a zip file of the top level directory (mkv in the $mkvingestdir). I don’t need that zip file. Additionally, the apxxxx.zip files don’t contain just the files, but also contain the directory path (i.e., inside the zip it is not just the .eap files, but mine/MKV/apxxxx/files). How would I go about eliminating the MKV zip file that is created, and limit the zip’s to only have the files, and not the directory structure? As for the single vs. double quotes that Anonymous mentioned…..as I said, I’ve been learning via websites for the most part, and I see all these different examples. I feel like I’m starting to understand the basics of perl, but there is always so much to learn. I know this code is not perfect, but I’m continually reading/studying to try and make it, and myself better. I really want to thank everyone for all the help with this. Having said all that, here is my code as it stands now
| [reply] [d/l] |
by Anonymous Monk on Dec 02, 2016 at 08:13 UTC | |
As for the single vs. double quotes that Anonymous mentioned…..as I said, I’ve been learning via websites for the most part, and I see all these different examples. :) syntax errors are syntax errors
"U+2018" "U+2019" are not valid syntax like "U+0027" "U+201C" "U+201D" are not valid syntax like "U+0022" You're posting code that doesn't use '' and "" but the smart quotes ... whatever editor you're using is helping corrupt the code you post | [reply] [d/l] |
by mrd1019 (Novice) on Nov 30, 2016 at 17:58 UTC | |
I was able to get rid of the MKV zip file. Forgot a couple of lines that stevieb had suggested. New code is:
Still trying to figure out how to remove the partial directory structure within the apxxxx.zip files | [reply] [d/l] |
by mrd1019 (Novice) on Nov 30, 2016 at 18:17 UTC | |
I GOT IT!!!!! (Sorry, very happy right now). Once I added in the next if statements, and had set to chdir, I made one last change, and the code now works as I want it to! Once again, a HUGE thank you to everyone that assisted!! Looking forward to continuing my journey here with perl. Newest code, in case anyone is wondering:
| [reply] [d/l] |