VOGONS


First post, by many408

User metadata
Rank Newbie
Rank
Newbie

I have about 6000 zipfiles, all with unique names but they all have the same filename (different file) inside.

I need to unzip them all and assign the unique zipfilename to the extracted file(s).

So I wrote a small quickbasic program which

shells to "dir *.zip > dir.txt"

then it runs through the dir.txt file and
a) extracts each zipfile's content (via shell to "unzip <filename>")
b) renames the extracted file via quickbasic's NAME command

This works, for about 15 minutes, then everything freezes. It starts going through the dir.txt file, reading and unzipping just fine, then somewhere between 100 and 200 (roughly) of the zipfiles processed, it hangs. It does not stop at the same file.

The computer is a Dell 630 running Ubuntu 12.04 and Windows 7; each with Dosbox 0.74. I have tried running the program in quickbasic interpreted mode and as a compiled (standalone .exe) in Ubuntu, and as a standalone .exe in win7.

When the Ubuntu freeze happens, everything slows down, and after a bit nothing works, no mouse, no Ctrl-Alt-T for terminal, I hit the power button to fix it.

When the Windows freeze happens, windows says the runtime has asked to be terminated in an unusual way. It does close the window and continue working, though.

I'm not comitted to using quickbasic, so if there was an unzip binary that would allow sequential renaming of the extracted file, or some way of doing this via batch files that's ok.

Reply 1 of 2, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Do you notice system memory usage going steadily up before the freeze?

Reply 2 of 2, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

http://support.microsoft.com/kb/40154 suggests that repeatedly using "shell" to execute an external program can cause memory problems. At any rate, since it happens with the standalone .exe in Windows 7, it's probably not a DOSBox problem.

many408 wrote:

I'm not comitted to using quickbasic, so if there was an unzip binary that would allow sequential renaming of the extracted file, or some way of doing this via batch files that's ok.

The brute-force way would be to open the list of files in Excel and use spreadsheet formulas to generate a 6,000-line batch file. Crude, but it works.

Alternatively, you should be able to put something together with FORFILES since you're running Windows 7. I can try to provide more details later if you have trouble figuring it out.

If you do feel like sticking with QuickBasic, perhaps you should consider a modern derivative such as QB64 or FreeBasic.