Archive: Logging a recursive Rename...


Logging a recursive Rename...
Hi, gotta tough one for you guys (I think). Work Internet connection is slightly dodgy so I haven't been able to browse through searching etc. for very long, but I will continue to do that as well as post this.

I need to log all files written to the hard drive in a text file (separate from my install.log, this is a filelist.log) as a requirement for the installer. Easy enough for normal files, I just have a macro which adds files, does error checking and logs to the 2 logfiles if successful.

However I also have a .zip file which needs to be extracted (can do that), and have each file extracted logged in filelist.log (can't do that). I used to capture the unzip.exe output and place that in a text file, but that gives more output than I want (says things like "inflating..." etc). All I want is the filename of each extracted file.

Any ideas of how I can do this? One thought of mine was to extract to a temporary directory, then move each file in turn to the actual directory, while recording where I put the file in the filelist.log. The .zip file is reasonably volatile so I can't predict what will be in it other than to say that inside the .zip there are various folders (which are always there, I can predict their names) and inside each folder is an unknown number of files.

Does that make sense? Any help muh appreciated. I'm here if you need me to clarify my problem.

Cheers guys

Rob


C'mon guys 11 views, no replies, what's going on? :)


If you are using the unzip.exe from Info-ZIP, you could use its built-in "ZipInfo" feature to generate a list of filenames/paths from the zip file.

Here is a snippet showing the output from the command "unzip -Z -1 nsis.zip"

NSIS/Examples/Modern UI/
NSIS/Examples/Modern UI/CVS/
NSIS/Examples/Modern UI/CVS/Root
NSIS/Examples/Modern UI/CVS/Repository
NSIS/Examples/Modern UI/CVS/Entries
NSIS/Examples/Modern UI/Basic.nsi
NSIS/Examples/Modern UI/HeaderBitmap.nsi
NSIS/Examples/Modern UI/InstallOptions.nsi
NSIS/Examples/Modern UI/MultiLanguage.nsi
NSIS/Examples/Modern UI/StartMenu.nsi
NSIS/Examples/Modern UI/WelcomeFinish.nsi
NSIS/Examples/Modern UI/ioA.ini
NSIS/Examples/Modern UI/ioB.ini
NSIS/Examples/Modern UI/ioC.ini

To find out more, read the documentation provided with UnZip or at least the built-in help ("unzip -help" and "unzip -Z")