|
Well come Franky Braem
I am developer of VFP9. I have used SAWZip.dll and work fine. But I am facing problem when files are used by other application, zip process failed. Kindly give me any solution.
Regards
Imran
|
|
|
|
|
It was mentioned below that version 2.6 could be downloaded from http://users.skynet.be/saw.
I cannot find the download anywhere on that site.
I have the version from Codeproject which so far seems to work fine.
Thanks
|
|
|
|
|
|
Hey coder dudes,
I found a bug in this today. Thought I'd post the solution in case anyone else is getting the same problem.
When using AddFileByName to add a file from a folder with fullPath=TRUE, e.g ...
AddFileByName("folder\\filename.ext",nLevel,TRUE,etc
... the folder that the file is in becomes LOCKED, meaning that it cannot be deleted until your process ends. This might not be desirable.
To fix it, you will need to modify the sourcecode of the SAWZip control.
Look in File.cpp for a call to the Win32 API FindFirstFile() function ... there is no corresponding call to FindClose(), so add one yourself.
FindFirstFile( fullFileName.c_str(), &FindData );<br />
FileTimeToDosDateTime(&FindData.ftLastWriteTime, &m_modDate, &m_modTime);
becomes:
HANDLE hBugFix=FindFirstFile( fullFileName.c_str(), &FindData );<br />
if(hBugFix!=INVALID_HANDLE_VALUE)<br />
{<br />
FileTimeToDosDateTime(&FindData.ftLastWriteTime, &m_modDate, &m_modTime);<br />
::FindClose(hBugFix);<br />
}
|
|
|
|
|
Hi,
It is a good idea with SAWZIP libriary.
But I can not use one because error message:
ActiveX component can not create object.
My enviroment:
Windows XP, VB6,
files zlib.dll,SAWZip.tlb,SAWZip.dll in system32.
Sincerely,
Vadim
vadim_s@netvision.net.il
|
|
|
|
|
has anyone in this forum used the method ExtractToStream using ASP
below is the code i used:
<%
//Response.Buffer = True
//Response.Clear
//Response.ContentType = "image/gif"
Set zip_file = Server.CreateObject("SawZip.Archive")
zip_file.open("\\infcty\xien\HelloWorld.zip")
//extract files that match file name
//????? donot know how to properly implement this method
//zip_file.Files.Item(0).ExtractToStream ( objStream )
zip_file.close()
%>
|
|
|
|
|
Hi,
Receive the following error using winzip 9 to open an archive.
No errors using winzip 8 or any version of winrar.
Any ideas?
Thanks.
error: start of central directory not found. Zip file corrupt.
Possible cause: file transfer error.
|
|
|
|
|
I ran into this problem too. I spent a few hours trying to figure it out, including a google search, which landed me on your post, with no responses.
I finally figured out what was causing my problem. I had been testing code modifications that were changing the file names in the zip file. That was the only change I had been making, the file contents were exactly the same, just the file names (in the zip file) were changed. Specifically, I had made them slightly shorter. This is when I first saw the error.
The problem was that I was using File.OpenWrite(filename) to open the file. This defaults to FileMode.OpenOrCreate, which since my zip file wasn't deleted between tests was opening the zip file and not truncating it. I would write my entries and close it, but since my filenames were a little shorter the contents of my new file didn't quite overwrite the contents of the previous test. As it turns out, zip files are not tolerant of garbage at the end, which also happens to be where they store their directory structure. So, make sure you open your file explicitly with File.Open(str, FileMode.Create, FileAccess.Write, FileShare.Whatever), or just delete it between tests.
Hope this helps save someone a few hours in the future.
|
|
|
|
|
Hi,
Does anyone know where I can find sample code for archiving in the cab format?
Thanks!
|
|
|
|
|
Hi i liked you component very much, Thank you very much.
but i didnt understand the need for a unicode version of this component, since this components has to compresss/decompress any type of data and plus it is no way involved with the display, then why unicode.
regards,
Prakash.
Tech.Support : Mam, is your pc running under windows?
Customer : No actually its close to the main door.
|
|
|
|
|
Hi. I've used this control for quite a while and I like it very much. Now I really NEED a spanning function (multi-volume archive) and wonder if perhaps it's already supported or if there are any plans on adding support for it. Thanks for a great piece of software!
|
|
|
|
|
I just saw that there is a new version supporting spanning (@ http://users.skynet.be/saw). Sorry about the posting.
|
|
|
|
|
Hello from France,
I was testing SAWZIP DLL and everything wotk fine until I try to open a zip file with this line :
ZIP.OPEN "\\SERVER\TEST\TEST.ZIP"
If I open local files there is no problem.
The path is correct and the file exist and not corupted.
The VB error message is strange because it tells me : "Operation succeeded"
Dont't know what to do.
Can someone help me ?
Thank You
|
|
|
|
|
I'm running w2k, vc++ 6, I have the Microsoft SDK stuff installed.
Firstly there are errors with unclear definitions of the ATL:: symbol in the routines (four of them in various files), which all contain code like the following:
static const IID* arr[] =
{
&IID_IFile,
};
/* commented out, ATL:: below is giving unclear
resolution errors
for (int i=0; i
|
|
|
|
|
Hey.
I'm trying to use SAWZipLib from c#.
I have added the component, and the usage
of the archive looks like fine for me.
I can create new archive, and add the files,
but, at the end of the process, the archive
contains files, with 0 size, and my memory usage
seems to be incorrect. (growed by 200Mbytes).
Maybe a bug of some forgotten fileclose?
How should I correct this problem?
|
|
|
|
|
ok. I have refreshed my version of SAWZip.
Now have an other problem.
If I try to change the name of the files, after compression,(for relative path)
only the first file is correct.
(with full path goes everything all-right)
Maybe the size of the filename string must be the same?
|
|
|
|
|
aha.
The filename must be the same size.
But how can I add the correct filenames with
properties, when '\0' defines the end of the string?
|
|
|
|
|
I've just posted a bug fix of SAWZip on my website. Now you can't change the name of the file anymore when it is added to the archive. Changing the name corrupted the zip file.
In the next major release 3.0 it will be possible to add files with their relative path. Only... I don't know when I can start developing it because I'm to busy with other projects and I have to develop it in my spare time. And because I don't earn money with SAWZip, the other projects have a higher priority.
|
|
|
|
|
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
{
if (::ATL::InlineIsEqualGUID(*arr[i],riid))
return S_OK;
}
Best regards...
|
|
|
|
|
Version (2.6) is released! On my new website : http://users.skynet.be/saw you can download a setup program which installs and registers the activex SAWZip automatically.
The following is changed:
Local date/time bug solved.
An extracted file gets the correct date.
AddDir method added. (add directories and subdirectories)
Check whether the file to compress is not the zip-file itself (in AddDir and AddFileByName).
Setup program for installing.
|
|
|
|
|
Dear Franky Braem,
I am using SawZip.dll and I want add whole directory and subdirectory into a zip file but version 2.0 is not supported. I visit your website but I don't see any where to download version 2.6. Could you send it to me by email or give me a directly link to get it.My email is nttrungyb@gmail.com. Thanks a lot.
|
|
|
|
|
Add a whole directory to zipfile -- much like what you can do with winzip.
Maybe I missed something, but I cannot do this with AddFileByName.
Here's my working directory structure
c:\Files\
a.gif
b.gif
Sub_dir
c.gif
d.gif
If I use
AddFileByName(A2BSTR("c:\\Files\\*"), 9, TRUE, TRUE);
only a.gif and b.gif is added to the zip file.
BTW, there's no path info attached to a.gif, b.gif.
Any help will be appreciated.
(PS, I always encounter runtime errors if I use smarter pointer with the import directive, anyone also get that error?)
---------------------------------------------
#import "SAWZip.tlb" no_namespace named_guid
main() {
USES_CONVERSION;
CoInitialize(NULL);
IClassFactory *pCF;
HRESULT hr;
hr = CoGetClassObject(__uuidof(Archive), CLSCTX_ALL, NULL, IID_IClassFactory, (void **)&pCF);
IArchive *archive;
hr = pCF->CreateInstance(NULL, __uuidof(IArchive), (void **)&archive);
archive->Create(A2BSTR("C:\\test.zip"));
IFiles *files = archive->Files;
files->AddFileByName(A2BSTR("c:\\Files\\*"), 9, TRUE, TRUE);
archive->Close();
archive->Release();
pCF->Release();
CoUninitialize();
}
|
|
|
|
|
OK. After studying the source, I have concluded that indeed this is not supported. However, I have found a easy way to add the whole directory by using another module provided by CP
IFiles *files = archive->Files;
CFileInfoArray cfia;
cfia.AddDir(workdir.c_str(), "*.*", TRUE,
CFileInfoArray::AP_SORTBYNAME | CFileInfoArray::AP_SORTASCENDING, FALSE);
for (int i=0; i< cfia.GetSize(); i++) {
files->AddFileByName(A2BSTR((LPCTSTR)(cfia[i].GetFilePath())), 9, VARIANT_TRUE, VARIANT_TRUE);
}
BTW, I'm not sure if the author aware that "relative path" info is more likely to be what the user wanted instead of the "full path" info.
Will this be included in the next release??
Anyway, nice work !!!
|
|
|
|
|
ufff. this relative-path problem makes me crying.
|
|
|
|
|
The new version (2.6) which you can download from my website contains a new method to add directories and subdirectories. Relative paths are still not possible while adding the files, but you can rename the files after they are added. Relative paths is a functionality for release 3.0.
|
|
|
|