« on: November 15, 2009, 08:43 AM »
same test for the script. it failed, doesn't support unicode.Oopsy. Let me fix that!J:\Share\Programs\@Network\eToolz\Language\English.lng
Traceback (most recent call last):
File "makeTreeZip.py", line 43, in <module>
WindowsError: [Error 123] The filename, directory name, or volume label syntax i
s incorrect: 'J:\\Share\\Programs\\@Network\\eToolz\\Language\\Fran?ais.bmp'-vixay (June 10, 2009, 11:06 PM)
.... There! http://codepad.org/ftWwtTGy
That version should handle
(a) zipping empty directories
(b) unicode filenames (as long as it can decode the command line...)
Picture proof here!-akx (June 11, 2009, 11:33 AM)
Great script - I'm using it to replicate the file and folder structure on my hard-disk on a schedule so i can take the result and email it to myself with a little extra python scripting. I already clone my hard-disk's contents once every week or so, but I can use this script to replicate the structure on a more regular basis (say once every 12 hours) and so when a drive does fail I can do a directory compare between the replicated structure on email and my last full clone to find out exactly what files I've completely lost, accurate to within 12 hours. Of course this doesn't help telling me what new changes I've lost to files that did make it into my last disk clone, but it's still helpful.
One small thing I noticed about your script is that it doesn't close off the zipfile when it's done replicating the folder/file structure. I added the line zf.close() to mine, before adding my own logic to email it to myself. I found myself running into problems with the email part if I didn't do this first. I imagine that once your script is fully done it must have been closing off the zipfile implicitly and so it's not really a problem for people not adding anything to it, but thought it could be worth mentioning for anyone else who may be looking to tweak your script.