>> WinZip and similar programs provide a way of distributing files, which let you unzip them without a dedicated application
WinZip *is* the dedicated application that unzips the files. it would be a simple matter to write a program that compresses/decompresses files and optionally deletes the archive when done. windows allows you to associate programs with file extensions programatically - I'm not exactly sure how to do that but I'm sure it's been posted on this board. to traverse a directory under windows you can use something like:
Code:
void printDirectory(const char * directory) {
HANDLE handle;
WIN32_FIND_DATA info;
if(SetCurrentDirectory(directory)) {
if((handle = FindFirstFile("*", &info)) != INVALID_HANDLE_VALUE) {
while(FindNextFile(handle, &info)) {
if(strcmp(info.cFileName, ".") != 0 && strcmp(info.cFileName, "..") != 0) {
cout << info.cFileName << endl;
if(info.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY) {
printDirectory(info.cFileName);
}
}
}
}
SetCurrentDirectory("..");
}
}
int main(void) {
printDirectory("C:\\");
return 0;
}