I created quite a neat application for backups. It just copies the directories you specify to wherever you want. Unfortunately I encountered a problem. The maximum length of the file path is about 250 so what happens is that the program can’t copy files if the new location path is longer – and the program collapses.
I learned that using zip archives would resolve the problem. But… The program uses some filters and it’s logic isn’t that straightforward. I really wouldn’t like to rewrite it all.
My program visits all subdirectories in a specified directory and checks if there are any new or modified files there. If it finds some it copies it to …./Backups/……../dir_A/dir_B/file. Every file and dir is processed separately (it’s checked if it was modified, if it fits the filters, etc)
What I need is something that would help me substitute Backups directory with Backups.zip Especially offering something like this:
myArchive.copyFile("dir_a/dir_b/...../file", original_file_path);
myArchive.fileModificationDate("dir_a/dir_b/...../file");
myArchive.getDirectotiesIn("dir_a/dir_b/");
Is there such a feature in .Net? Or maybe there is a free library for this?
There are mainly two free alternatives for handling zip files in c# :
I prefer DotNetZip.